Sync versus async reset of cut in dig.v?
KeithE
Posts: 957
Chip - did you intend for cnt to be reset synchronously in dig.v? It looks like your other resets are all async.
// cnt reg [31:0] cnt; always @(posedge clk_cog) // KeithE - sensitivity list only contains the clock if (nres) cnt <= cnt + 1'b1; // bus enable reg ena_bus; always @(posedge clk_cog or negedge nres) if (!nres) ena_bus <= 1'b0; else ena_bus <= !ena_bus;
Comments
(It would make gate sims fun.)
I haven't seen anyplace where it gets set to 0.
This Verilog code represents what is actually in the P8X32A chip.
If you need a CNT that starts at 0 on reset, then you can add that for your simulations. It sure won't hurt anything in your simulated propeller. That's the wonderful thing about having a P1 in Verilog!!
The problem is that cnt will stay at X in simulations otherwise.
and it will start with 0
Add if (!nres) cnt<=0 and it will be zero at every reset.
That is what Chips reply means. Its normally not relevant.