Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[New Feature] fix decode PIN for latest RTL, sub make command etc. #39

Merged
merged 4 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ clean:
clean_dut:
cd dut && ls | grep -v __init__.py | xargs rm -rf

test_all:
clean_rtl:
cd rtl && ls | grep -v README.md | xargs rm -rf

test_all: dut
@python3 run.py --config $(CFG) $(KV) -- $(REPORT) -vs ut_*/ $(args)

test:
test: dut
@python3 run.py --config $(CFG) $(KV) -- $(REPORT) -vs $(target) $(args)

dut:
dut: rtl
@python3 run.py --config $(CFG) --build $(DUTS) $(args)

rtl:
Expand Down
25 changes: 15 additions & 10 deletions comm/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,20 @@ def download_rtl(base_url, out_dir, version="latest"):
use_rtl(base_url.split("/")[-1], out_dir)
return True

def _build_dut(d, cfg):
try:
module = importlib.import_module(f"scripts.{d}")
if not module.build(cfg):
warning(f"Build scripts/{d}.py failed")
else:
info(f"Build scripts/{d}.py success")
except Exception as e:
warning(f"Failed to build {d}, error: {e}\n{traceback.format_exc()}")

def build_dut(duts, cfg):
target_duts = [d.strip() for d in duts.split(",")]
if len(target_duts) == 0:
warning(f"No dut to build for: {duts}")
return
prefix = "build_ut_"
build_modules = [f.replace(".py", "") for f in
Expand All @@ -199,16 +209,11 @@ def build_dut(duts, cfg):
if len(dut_to_build) == 0:
warning(f"No dut to build for: {duts}")
return
for d in dut_to_build:
debug(f"Build {d}")
try:
module = importlib.import_module(f"scripts.{d}")
if not module.build(cfg):
warning(f"Build scripts/{d}.py failed")
else:
info(f"Build scripts/{d}.py success")
except Exception as e:
warning(f"Failed to build {d}, error: {e}\n{traceback.format_exc()}")
import multiprocessing
pool = multiprocessing.Pool()
pool.starmap(_build_dut, [(d, cfg) for d in dut_to_build])
pool.close()
pool.join()


def replace_default_vars(input_str, cfg):
Expand Down
3 changes: 2 additions & 1 deletion ut_backend/ctrl_block/decode/env/decode_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ def Reset(self):
def Input_instruction(self, i, valid, instr, isRVC, brType, isCall, isRet, pred_taken, instr_ex):
self.input_inst[i].valid.value = valid
self.input_inst[i].bits_instr.value = instr
self.input_inst[i].bits_foldpc.value = 0
if hasattr(self.input_inst[i], "bits_foldpc"):
self.input_inst[i].bits_foldpc.value = 0
self.input_inst[i].bits_exceptionVec_2.value = instr_ex
for j in range(24):
p = getattr(self.dut, f'io_in_{i}_bits_exceptionVec_{j}', None)
Expand Down
Loading