-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into lekcyjna/basic-fifo-tweaks
- Loading branch information
Showing
22 changed files
with
230 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Full transaction-method graph | ||
|
||
<div style="overflow: scroll; white-space: nowrap"> | ||
<div style="width: 2000%; height: 2000%"> | ||
|
||
```{eval-rst} | ||
.. include:: auto_graph.rst | ||
``` | ||
|
||
</div> | ||
</div> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import sys | ||
import os | ||
import pathlib | ||
import xml.etree.ElementTree as eT | ||
|
||
FAILURE_TAG = "failure" | ||
TOP_DIR = pathlib.Path(__file__).parent.parent | ||
TEST_RESULTS_FILE = TOP_DIR.joinpath("test/regression/cocotb/results.xml") | ||
|
||
if not os.path.exists(TEST_RESULTS_FILE): | ||
print("File not found: ", TEST_RESULTS_FILE) | ||
sys.exit(1) | ||
|
||
tree = eT.parse(TEST_RESULTS_FILE) | ||
|
||
if len(list(tree.iter(FAILURE_TAG))) > 0: | ||
print("Some regression tests failed") | ||
sys.exit(1) | ||
|
||
print("All regression tests pass") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
from ..common import TestCaseWithSimulator, SimpleTestCircuit | ||
|
||
from coreblocks.structs_common.rat import FRAT, RRAT | ||
from coreblocks.params import GenParams | ||
from coreblocks.params.configurations import test_core_config | ||
|
||
from collections import deque | ||
from random import Random | ||
|
||
|
||
class TestFrontendRegisterAliasTable(TestCaseWithSimulator): | ||
def gen_input(self): | ||
for _ in range(self.test_steps): | ||
rl = self.rand.randrange(self.gen_params.isa.reg_cnt) | ||
rp = self.rand.randrange(1, 2**self.gen_params.phys_regs_bits) if rl != 0 else 0 | ||
rl_s1 = self.rand.randrange(self.gen_params.isa.reg_cnt) | ||
rl_s2 = self.rand.randrange(self.gen_params.isa.reg_cnt) | ||
|
||
self.to_execute_list.append({"rl": rl, "rp": rp, "rl_s1": rl_s1, "rl_s2": rl_s2}) | ||
|
||
def do_rename(self): | ||
for _ in range(self.test_steps): | ||
to_execute = self.to_execute_list.pop() | ||
res = yield from self.m.rename.call( | ||
rl_dst=to_execute["rl"], rp_dst=to_execute["rp"], rl_s1=to_execute["rl_s1"], rl_s2=to_execute["rl_s2"] | ||
) | ||
self.assertEqual(res["rp_s1"], self.expected_entries[to_execute["rl_s1"]]) | ||
self.assertEqual(res["rp_s2"], self.expected_entries[to_execute["rl_s2"]]) | ||
|
||
self.expected_entries[to_execute["rl"]] = to_execute["rp"] | ||
|
||
def test_single(self): | ||
self.rand = Random(0) | ||
self.test_steps = 2000 | ||
self.gen_params = GenParams(test_core_config.replace(phys_regs_bits=5, rob_entries_bits=6)) | ||
m = SimpleTestCircuit(FRAT(gen_params=self.gen_params)) | ||
self.m = m | ||
|
||
self.log_regs = self.gen_params.isa.reg_cnt | ||
self.phys_regs = 2**self.gen_params.phys_regs_bits | ||
|
||
self.to_execute_list = deque() | ||
self.expected_entries = [0 for _ in range(self.log_regs)] | ||
|
||
self.gen_input() | ||
with self.run_simulation(m) as sim: | ||
sim.add_sync_process(self.do_rename) | ||
|
||
|
||
class TestRetirementRegisterAliasTable(TestCaseWithSimulator): | ||
def gen_input(self): | ||
for _ in range(self.test_steps): | ||
rl = self.rand.randrange(self.gen_params.isa.reg_cnt) | ||
rp = self.rand.randrange(1, 2**self.gen_params.phys_regs_bits) if rl != 0 else 0 | ||
side_fx = self.rand.randrange(0, 2) | ||
|
||
self.to_execute_list.append({"rl": rl, "rp": rp, "side_fx": side_fx}) | ||
|
||
def do_commit(self): | ||
for _ in range(self.test_steps): | ||
to_execute = self.to_execute_list.pop() | ||
res = yield from self.m.commit.call( | ||
rl_dst=to_execute["rl"], rp_dst=to_execute["rp"], side_fx=to_execute["side_fx"] | ||
) | ||
self.assertEqual(res["old_rp_dst"], self.expected_entries[to_execute["rl"]]) | ||
|
||
if to_execute["side_fx"]: | ||
self.expected_entries[to_execute["rl"]] = to_execute["rp"] | ||
|
||
def test_single(self): | ||
self.rand = Random(0) | ||
self.test_steps = 2000 | ||
self.gen_params = GenParams(test_core_config.replace(phys_regs_bits=5, rob_entries_bits=6)) | ||
m = SimpleTestCircuit(RRAT(gen_params=self.gen_params)) | ||
self.m = m | ||
|
||
self.log_regs = self.gen_params.isa.reg_cnt | ||
self.phys_regs = 2**self.gen_params.phys_regs_bits | ||
|
||
self.to_execute_list = deque() | ||
self.expected_entries = [0 for _ in range(self.log_regs)] | ||
|
||
self.gen_input() | ||
with self.run_simulation(m) as sim: | ||
sim.add_sync_process(self.do_commit) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.