Skip to content

Commit

Permalink
modify global vars path and wave conver method
Browse files Browse the repository at this point in the history
  • Loading branch information
maksyuki committed Mar 3, 2024
1 parent 24ed95f commit 40e29fe
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 19 deletions.
34 changes: 18 additions & 16 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,28 @@
# CUR_BRAN = '202302'
CUR_BRAN = 'main' # NOTE: just for test
HOME_DIR = os.getcwd() + '/'
DATA_DIR = HOME_DIR + '../data/' + CUR_BRAN
SUBMIT_LIST_PATH = DATA_DIR + '/submit_list'
CORE_LIST_PATH = DATA_DIR + '/core_list'
QUEUE_LIST_PATH = DATA_DIR + '/queue_list'
RUN_LOG_PATH = DATA_DIR + '/run.log'
DATA_DIR = f'{HOME_DIR}../data/CUR_BRAN'
SUBMIT_LIST_PATH = f'{DATA_DIR}/submit_list'
CORE_LIST_PATH = f'{DATA_DIR}/core_list'
QUEUE_LIST_PATH = f'{DATA_DIR}/queue_list'
RUN_LOG_PATH = f'{DATA_DIR}/run.log'
# NOTE: need to modify the SUBMIT_DIR path for the CICD repo
# now just for test
SUBMIT_DIR = HOME_DIR + '../tests/intg'
SUB_DIR = SUBMIT_DIR + '/submit'
RPT_DIR = SUBMIT_DIR + '/report'
SUBMIT_DIR = f'{HOME_DIR}../tests/intg'
SUB_DIR = f'{SUBMIT_DIR}/submit'
RPT_DIR = f'{SUBMIT_DIR}/report'
WAVE_DIR = f'{HOME_DIR}../tests/wave'

# vcs
VCS_DIR = HOME_DIR + '../vcs'
VCS_RUN_DIR = VCS_DIR + '/run'
VCS_CPU_DIR = VCS_DIR + '/cpu'
VCS_SCRIPT_DIR = VCS_DIR + '/script'
VCS_DIR = f'{HOME_DIR}../vcs'
VCS_RUN_DIR = f'{VCS_DIR}/run'
VCS_CPU_DIR = f'{VCS_DIR}/cpu'
VCS_SCRIPT_DIR = f'{VCS_DIR}/script'
# dc
DC_SRC_DIR = HOME_DIR + '../lib/dc/bes_data/syn/scr'
DC_CFG_DIR = HOME_DIR + '../lib/dc/bes_data/common'
DC_LOG_DIR = DC_SRC_DIR + '../log'
DC_RPT_DIR = DC_SRC_DIR + '../rpt'
DC_SRC_DIR = f'{HOME_DIR}../lib/dc/bes_data/syn/scr'
DC_CFG_DIR = f'{HOME_DIR}../lib/dc/bes_data/common'
DC_LOG_DIR = f'{DC_SRC_DIR}../log'
DC_RPT_DIR = f'{DC_SRC_DIR}../rpt'

TESTCASE_NAME_LIST = ['hello', 'memtest', 'rtthread']
TESTCASE_TYPE_LIST = ['flash', 'mem', 'sdram']
Expand Down
2 changes: 1 addition & 1 deletion src/def_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ flag = "vcs" # commit flag[dont use]
freq = 25
prog = {name = "", type = ""} # format: [name]-[type] name: [hello, memtest, rtthread] type: [flash, mem, sdram]
# leave name item a blank mean test all programs
wave = "off" # [off on]
wave = "off" # [off on] note: wave option only valid when prog.name is not a blank and wave is "on"

[dc]
flag = "dc" # flag[dont use]
Expand Down
20 changes: 18 additions & 2 deletions src/vcs_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ def collect_run_log(self, prog_name: str, prog_type: str):

self.run_res[f'{prog_name}-{prog_type}'] = tmp_res

def gen_wave_rpt(self):
os.chdir(config.VCS_RUN_DIR)
wave_name = f'{self.dut_cfg.top}_{self.vcs_cfg.prog[0]}_{self.vcs_cfg.prog[1]}'
os.system(f'fsdb2vcd asic_top.fsdb -o {wave_name}.vcd')
os.system(f'vcd2fst -v {wave_name}.vcd -f {wave_name}.fst')
os.chdir(config.HOME_DIR)

def comp(self):
os.chdir(config.VCS_RUN_DIR)
os.system('make comp')
Expand All @@ -113,8 +120,16 @@ def run(self):

else:
self.program(self.vcs_cfg.prog[0], self.vcs_cfg.prog[1])
os.system(
f'make run test={self.vcs_cfg.prog[0]}-{self.vcs_cfg.prog[1]}')
if self.vcs_cfg.wave == 'off':
os.system(
f'make run test={self.vcs_cfg.prog[0]}-{self.vcs_cfg.prog[1]}'
)
else:
os.system(
f'make run test={self.vcs_cfg.prog[0]}-{self.vcs_cfg.prog[1]} wave=on'
)
self.gen_wave_rpt()

self.collect_run_log(self.vcs_cfg.prog[0], self.vcs_cfg.prog[1])

def gen_rpt_dir(self) -> str:
Expand All @@ -123,6 +138,7 @@ def gen_rpt_dir(self) -> str:
os.system(f'mkdir -p {rpt_path}')
return rpt_path


def gen_comp_rpt(self) -> bool:
rpt_path = self.gen_rpt_dir()
with open(f'{rpt_path}/vcs_report', 'a+', encoding='utf-8') as fp:
Expand Down

0 comments on commit 40e29fe

Please sign in to comment.