Skip to content

Commit

Permalink
fix gold gen
Browse files Browse the repository at this point in the history
  • Loading branch information
mbstrange2 committed Aug 7, 2024
1 parent 1257f57 commit f29e296
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions tests/test_spec/dual_port_rv.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def build_simple_dual_port(storage_capacity: int = 1024, data_width=16,
dims: int = 6, clock_count_width=16, physical=False,
recurrence=True, reg_file=False) -> Spec:

read_delay = 0 if reg_file else 1
read_delay = 1 if reg_file else 1

ls = Spec()

Expand Down Expand Up @@ -174,9 +174,8 @@ def test_linear_read_write(output_dir=None, storage_capacity=1024, data_width=16
datas = sequences['data']
if times[-1] > max_time:
max_time = times[-1]
# Need to add a cycle delay if using SRAM
if reg_file is False:
times = [time + 1 for time in times]
# Need to add a cycle delay if using SRAM or reg file
times = [time + 1 for time in times]
gold_output_path_data = os.path.join(output_dir, "gold", f"{port_name}_data.txt")
gold_output_path_time = os.path.join(output_dir, "gold", f"{port_name}_time.txt")
with open(gold_output_path_data, 'w') as file:
Expand Down
7 changes: 3 additions & 4 deletions tests/test_spec/simple_dual_port.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def build_simple_dual_port(storage_capacity: int = 1024, data_width=16,
dims: int = 6, clock_count_width=16, physical=False,
recurrence=True, reg_file=False) -> Spec:

read_delay = 0 if reg_file else 1
read_delay = 1 if reg_file else 1

ls = Spec()

Expand Down Expand Up @@ -158,9 +158,8 @@ def test_linear_read_write(output_dir=None, storage_capacity=1024, data_width=16
datas = sequences['data']
if times[-1] > max_time:
max_time = times[-1]
# Need to add a cycle delay if using SRAM
if reg_file is False:
times = [time + 1 for time in times]
# Need to add a cycle delay if using SRAM or reg file
times = [time + 1 for time in times]
gold_output_path_data = os.path.join(output_dir, "gold", f"{port_name}_data.txt")
gold_output_path_time = os.path.join(output_dir, "gold", f"{port_name}_time.txt")
with open(gold_output_path_data, 'w') as file:
Expand Down

0 comments on commit f29e296

Please sign in to comment.