Skip to content

Commit

Permalink
fix(sim): fix timer core simulation
Browse files Browse the repository at this point in the history
  • Loading branch information
P-Miranda committed Oct 12, 2023
1 parent 44a6ee0 commit 613c78c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
17 changes: 10 additions & 7 deletions hardware/simulation/src/timer_tb.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ module timer_tb;

integer fd;

reg clk;
`IOB_CLOCK(clk, PER)

reg rst;

`IOB_VAR(TIMER_ENABLE, 1)
`IOB_VAR(TIMER_SAMPLE, 1)
`IOB_WIRE(TIMER_VALUE, 2 * DATA_W)
reg TIMER_ENABLE;
reg TIMER_SAMPLE;
wire [2*DATA_W-1:0] TIMER_VALUE;

initial begin
`ifdef VCD
Expand Down Expand Up @@ -57,12 +59,13 @@ module timer_tb;

//instantiate timer core
timer_core timer0 (
.TIMER_ENABLE(TIMER_ENABLE),
.TIMER_SAMPLE(TIMER_SAMPLE),
.TIMER_VALUE (TIMER_VALUE),
.en_i(TIMER_ENABLE),
.rstrb_i(TIMER_SAMPLE),
.time_o(TIMER_VALUE),
.clk_i (clk),
.cke_i (1'b1),
.arst_i (rst)
.arst_i (rst),
.rst_i (rst)
);

endmodule
3 changes: 3 additions & 0 deletions iob_timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
# Submodules
from iob_utils import iob_utils
from iob_reg_re import iob_reg_re
from iob_reg_e import iob_reg_e
from iob_counter import iob_counter


Expand All @@ -25,10 +26,12 @@ def _create_submodules_list(cls):
# Hardware headers & modules
{"interface": "iob_s_port"},
{"interface": "iob_s_portmap"},
{"interface": "iob_wire"},
{"interface": "clk_en_rst_s_s_portmap"},
{"interface": "clk_en_rst_s_port"},
iob_utils,
iob_reg_re,
iob_reg_e,
iob_counter,
]
)
Expand Down

0 comments on commit 613c78c

Please sign in to comment.