Skip to content

Commit

Permalink
Merge pull request #125 from zeroasiccorp/ali/split_parameter_fix
Browse files Browse the repository at this point in the history
Add split parameter back into fifo flex and fix testbench
  • Loading branch information
volkamir authored Feb 28, 2024
2 parents 4e8086a + f2ccade commit 0232df3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
11 changes: 7 additions & 4 deletions umi/testbench/test_fifo_flex.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
THIS_DIR = Path(__file__).resolve().parent


def build_testbench():
def build_testbench(split=False):
dut = SbDut('testbench', default_main=True)

EX_DIR = Path('..')
Expand All @@ -26,6 +26,7 @@ def build_testbench():
dut.add('option', 'ydir', 'lambdalib/ramlib/rtl', package='lambdalib')
dut.add('option', 'ydir', 'lambdalib/stdlib/rtl', package='lambdalib')
dut.add('option', 'ydir', 'lambdalib/vectorlib/rtl', package='lambdalib')
dut.add('option', 'define', f'SPLIT={int(split)}')

for option in ['ydir', 'idir']:
dut.add('option', option, EX_DIR / 'rtl')
Expand All @@ -49,12 +50,12 @@ def build_testbench():
return dut.find_result('vexe', step='compile')


def main(vldmode="2", rdymode="2", host2dut="host2dut_0.q", dut2host="dut2host_0.q"):
def main(vldmode="2", rdymode="2", host2dut="host2dut_0.q", dut2host="dut2host_0.q", split=False):
# clean up old queues if present
for q in [host2dut, dut2host]:
delete_queue(q)

verilator_bin = build_testbench()
verilator_bin = build_testbench(split=split)

# launch the simulation
ret_val = verilator_run(verilator_bin, plusargs=['trace', ('valid_mode', vldmode), ('ready_mode', rdymode)])
Expand Down Expand Up @@ -91,7 +92,9 @@ def main(vldmode="2", rdymode="2", host2dut="host2dut_0.q", dut2host="dut2host_0
parser = ArgumentParser()
parser.add_argument('--vldmode', default='2')
parser.add_argument('--rdymode', default='2')
parser.add_argument('--split', action='store_true')
args = parser.parse_args()

main(vldmode=args.vldmode,
rdymode=args.rdymode)
rdymode=args.rdymode,
split=args.split)
9 changes: 6 additions & 3 deletions umi/testbench/testbench_fifo_flex.sv
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,12 @@ module testbench (
parameter integer CW=32;
parameter integer CTRLW=8;
parameter integer DEPTH=512;
parameter integer SPLIT=1;
parameter integer ASYNC=0;

`ifndef SPLIT
`define SPLIT 0
`endif

/*AUTOWIRE*/
// Beginning of automatic wires (for undeclared instantiated-module outputs)
wire [CW-1:0] umi_req_out_cmd;
Expand Down Expand Up @@ -110,7 +113,7 @@ module testbench (
.fifo_.* (),
);*/
umi_fifo_flex #(.ASYNC(ASYNC),
.SPLIT(SPLIT),
.SPLIT(`SPLIT),
.IDW(IDW),
.ODW(ODW),
.CW(CW),
Expand Down Expand Up @@ -183,7 +186,7 @@ module testbench (
.fifo_.* (),
);*/
umi_fifo_flex #(.ASYNC(ASYNC),
.SPLIT(SPLIT),
.SPLIT(`SPLIT),
.IDW(ODW),
.ODW(IDW),
.CW(CW),
Expand Down

0 comments on commit 0232df3

Please sign in to comment.