Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.
/ veriwell Public archive

Commit

Permalink
Fixed bug 1716620: constant expressions on primitive ports were not b…
Browse files Browse the repository at this point in the history
…eing propagaged at time 0.
  • Loading branch information
markhummel committed May 22, 2008
1 parent 6d3bd7f commit 6eb8df6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
9 changes: 9 additions & 0 deletions src/exec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1040,6 +1040,15 @@ tree exec_(tree pc)
}
}
break;
case GATE_INSTANCE:
{
SCB* scb = readylist;
if( scb->here.marker ) {
NotifyEvent( scb->here.marker, ZERO, 0 );
}
pc = dispatch_pc(FREE_LIST);
}
break;

case 0:
printf_error_V("Attempt to execute NULL instruction!\n");
Expand Down
19 changes: 17 additions & 2 deletions src/gates.cc
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ void initialize_gates(void)
tree gate;
enum logical_value was_output;


for (gate = PeekGate(); gate; gate = PeekGate()) {
ASSERT(TREE_CODE(gate) == GATE_INSTANCE);
RemoveGate(gate);
Expand All @@ -286,6 +285,22 @@ void initialize_gates(void)
if (was_output != X) {
handle_gate(gate);
}
/*
* Create an scb and schedule to run at time 0.
* Link all inputs on a marker chain to cause
* all input to reevaluated.
*/
SCB* scb = BuildSCB(gate, NOLIST);
scb->here.marker = NULL;
for (tree t = GATE_INPUT_LIST(gate); t; t = TREE_CHAIN(t)) {
Marker* marker = (Marker *) xmalloc(sizeof(Marker));
marker->next = scb->here.marker;
scb->here.marker = marker;
marker->scb = (SCB*)gate;
marker->flags = (enum marker_flags) (M_PRIM|M_FIXED);
marker->expr.arg = t;
}
Schedule(0,scb,0);
}
}

Expand Down Expand Up @@ -1300,12 +1315,12 @@ void xnor_exec(struct Marker *marker)

void buf_exec(struct Marker *marker)
{
ASSERT(marker != NULL);
tree gate = (tree) marker->scb;
tree arg;
enum logical_value in_new, in_old, out_new, out_old;
nbits_t nbits;

ASSERT(marker != NULL);
ASSERT(gate != NULL);

/* This is the arg expression, code, and last value */
Expand Down
1 change: 1 addition & 0 deletions src/schedule.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ typedef struct SCB {
struct SCB *scb; /* In case there are many SCBs waiting on the same event */
struct context_member *fork_list; /* If at fork, point to members */
union tree_node *decl; /* for nonblock assigns */
Marker* marker; /* used for gate intialization */
} here; /* This is valid while waiting at a particular place */
} SCB;

Expand Down

0 comments on commit 6eb8df6

Please sign in to comment.