forked from XS-MLVP/UnityChipForXiangShan
Compare commits
No commits in common. "develop" and "main" have entirely different histories.
9
Makefile
9
Makefile
|
|
@ -18,16 +18,13 @@ clean:
|
||||||
clean_dut:
|
clean_dut:
|
||||||
cd dut && ls | grep -v __init__.py | xargs rm -rf
|
cd dut && ls | grep -v __init__.py | xargs rm -rf
|
||||||
|
|
||||||
clean_rtl:
|
test_all:
|
||||||
cd rtl && ls | grep -v README.md | xargs rm -rf
|
|
||||||
|
|
||||||
test_all: dut
|
|
||||||
@python3 run.py --config $(CFG) $(KV) -- $(REPORT) -vs ut_*/ $(args)
|
@python3 run.py --config $(CFG) $(KV) -- $(REPORT) -vs ut_*/ $(args)
|
||||||
|
|
||||||
test: dut
|
test:
|
||||||
@python3 run.py --config $(CFG) $(KV) -- $(REPORT) -vs $(target) $(args)
|
@python3 run.py --config $(CFG) $(KV) -- $(REPORT) -vs $(target) $(args)
|
||||||
|
|
||||||
dut: rtl
|
dut:
|
||||||
@python3 run.py --config $(CFG) --build $(DUTS) $(args)
|
@python3 run.py --config $(CFG) --build $(DUTS) $(args)
|
||||||
|
|
||||||
rtl:
|
rtl:
|
||||||
|
|
|
||||||
|
|
@ -180,20 +180,10 @@ def download_rtl(base_url, out_dir, version="latest"):
|
||||||
use_rtl(base_url.split("/")[-1], out_dir)
|
use_rtl(base_url.split("/")[-1], out_dir)
|
||||||
return True
|
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):
|
def build_dut(duts, cfg):
|
||||||
target_duts = [d.strip() for d in duts.split(",")]
|
target_duts = [d.strip() for d in duts.split(",")]
|
||||||
if len(target_duts) == 0:
|
if len(target_duts) == 0:
|
||||||
warning(f"No dut to build for: {duts}")
|
|
||||||
return
|
return
|
||||||
prefix = "build_ut_"
|
prefix = "build_ut_"
|
||||||
build_modules = [f.replace(".py", "") for f in
|
build_modules = [f.replace(".py", "") for f in
|
||||||
|
|
@ -209,11 +199,16 @@ def build_dut(duts, cfg):
|
||||||
if len(dut_to_build) == 0:
|
if len(dut_to_build) == 0:
|
||||||
warning(f"No dut to build for: {duts}")
|
warning(f"No dut to build for: {duts}")
|
||||||
return
|
return
|
||||||
import multiprocessing
|
for d in dut_to_build:
|
||||||
pool = multiprocessing.Pool()
|
debug(f"Build {d}")
|
||||||
pool.starmap(_build_dut, [(d, cfg) for d in dut_to_build])
|
try:
|
||||||
pool.close()
|
module = importlib.import_module(f"scripts.{d}")
|
||||||
pool.join()
|
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 replace_default_vars(input_str, cfg):
|
def replace_default_vars(input_str, cfg):
|
||||||
|
|
|
||||||
|
|
@ -167,7 +167,6 @@ class Decode(toffee.Bundle):
|
||||||
def Input_instruction(self, i, valid, instr, isRVC, brType, isCall, isRet, pred_taken, instr_ex):
|
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].valid.value = valid
|
||||||
self.input_inst[i].bits_instr.value = instr
|
self.input_inst[i].bits_instr.value = instr
|
||||||
if hasattr(self.input_inst[i], "bits_foldpc"):
|
|
||||||
self.input_inst[i].bits_foldpc.value = 0
|
self.input_inst[i].bits_foldpc.value = 0
|
||||||
self.input_inst[i].bits_exceptionVec_2.value = instr_ex
|
self.input_inst[i].bits_exceptionVec_2.value = instr_ex
|
||||||
for j in range(24):
|
for j in range(24):
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue