Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/cells/base.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,8 @@ export const Gate = joint.dia.Element.define('Gate', {
_gateLayoutParams: ['position'],
_unsupportedPropChanges: [],
_operationHelpers: [],
_presentationParams: []
_presentationParams: [],
_gateKind: 'combinational'
});

export const GateView = joint.dia.ElementView.extend({
Expand Down
9 changes: 6 additions & 3 deletions src/cells/bus.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ export const BitExtend = Box.define('BitExtend', {
}
]),
_gateParams: Box.prototype._gateParams.concat(['extend']),
_operationHelpers: Box.prototype._operationHelpers.concat(['_extBit'])
_operationHelpers: Box.prototype._operationHelpers.concat(['_extBit']),
_gateKind: 'bus'
});
export const BitExtendView = BoxView.extend({
_autoResizeBox: true,
Expand Down Expand Up @@ -102,7 +103,8 @@ export const BusSlice = Box.define('BusSlice', {
const s = this.get('slice');
return { out: data.in.slice(s.first, s.first + s.count) };
},
_gateParams: Box.prototype._gateParams.concat(['slice'])
_gateParams: Box.prototype._gateParams.concat(['slice']),
_gateKind: 'bus'
});
export const BusSliceView = BoxView.extend({
_autoResizeBox: true
Expand Down Expand Up @@ -137,7 +139,8 @@ export const BusRegroup = Box.define('BusRegroup', {
Box.prototype.initialize.apply(this, arguments);
},
_gateParams: Box.prototype._gateParams.concat(['groups']),
_unsupportedPropChanges: Box.prototype._unsupportedPropChanges.concat(['groups'])
_unsupportedPropChanges: Box.prototype._unsupportedPropChanges.concat(['groups']),
_gateKind: 'bus'
});
export const BusRegroupView = BoxView.extend({
_autoResizeBox: true
Expand Down
3 changes: 2 additions & 1 deletion src/cells/dff.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ export const Dff = Box.define('Dff', {
} else return apply_sr(this.get('outputSignals').out);
},
_gateParams: Box.prototype._gateParams.concat(['polarity', 'bits', 'initial', 'arst_value', 'srst_value', 'enable_srst', 'no_data']),
_unsupportedPropChanges: Box.prototype._unsupportedPropChanges.concat(['polarity', 'bits', 'initial', 'arst_value', 'srst_value', 'enable_srst', 'no_data'])
_unsupportedPropChanges: Box.prototype._unsupportedPropChanges.concat(['polarity', 'bits', 'initial', 'arst_value', 'srst_value', 'enable_srst', 'no_data']),
_gateKind: 'stateful'
});
export const DffView = BoxView.extend({
_autoResizeBox: true
Expand Down
3 changes: 2 additions & 1 deletion src/cells/fsm.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ export const FSM = Box.define('FSM', {
markup: Box.prototype.markup.concat(Box.prototype.markupZoom),
_gateParams: Box.prototype._gateParams.concat(['bits', 'polarity', 'states', 'init_state', 'trans_table']),
_unsupportedPropChanges: Box.prototype._unsupportedPropChanges.concat(['bits', 'polarity', 'states', 'init_state', 'trans_table']),
_presentationParams: Box.prototype._presentationParams.concat(['current_state', 'next_trans'])
_presentationParams: Box.prototype._presentationParams.concat(['current_state', 'next_trans']),
_gateKind: 'stateful'
});

export const FSMView = BoxView.extend({
Expand Down
3 changes: 2 additions & 1 deletion src/cells/memory.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,8 @@ export const Memory = Box.define('Memory', {
},
_gateParams: Box.prototype._gateParams.concat(['bits', 'abits', 'rdports', 'wrports', 'words', 'offset']),
_unsupportedPropChanges: Box.prototype._unsupportedPropChanges.concat(['bits', 'abits', 'rdports', 'wrports', 'words', 'offset']),
_operationHelpers: Box.prototype._operationHelpers.concat(['_memrdports', '_memwrports', '_memports', '_calcaddr'])
_operationHelpers: Box.prototype._operationHelpers.concat(['_memrdports', '_memwrports', '_memports', '_calcaddr']),
_gateKind: 'stateful'
});
export const MemoryView = BoxView.extend({
_autoResizeBox: true,
Expand Down
5 changes: 4 additions & 1 deletion src/circuit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,9 @@ export function getCellType(tp) {
}

export class HeadlessCircuit {
constructor(data, {cellsNamespace = {}, engine = SynchEngine, engineOptions = {}} = {}) {
constructor(data, {cellsNamespace = {}, engine = SynchEngine, engineOptions = {}, defaultCombinationalPropagation} = {}) {
this._cells = Object.assign(cells, cellsNamespace);
this._defaultCombinationalPropagation = defaultCombinationalPropagation;
this._display3vl = new Display3vl();
this._display3vl.addDisplay(new help.Display3vlASCII());
this._graph = this._makeGraph(data, data.subcircuits);
Expand Down Expand Up @@ -161,6 +162,8 @@ export class HeadlessCircuit {
cellArgs.id = devid;
if (cellType == this._cells.Subcircuit)
cellArgs.graph = this._makeGraph(subcircuits[dev.celltype], subcircuits, { nested: true });
if (this._defaultCombinationalPropagation !== undefined && !('propagation' in cellArgs) && cellType.prototype._gateKind == 'combinational')
cellArgs.propagation = this._defaultCombinationalPropagation;
const cell = new cellType(cellArgs);
graph.addCell(cell);
}
Expand Down
Loading