Skip to content

Commit

Permalink
fix: fix some typos
Browse files Browse the repository at this point in the history
  • Loading branch information
maksyuki committed Feb 25, 2024
1 parent 623a863 commit 889ae1e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
25 changes: 15 additions & 10 deletions src/config_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ def check_file_top_clk(self, cfg_list: Dict[str, Any]) -> Tuple[bool, str]:
return (False, 'top module dont exist')

# not check if clk signal is in top module
if config.find_str(
cfg_list['file'],
f'\\s*module\\s*{cfg_list["clk"]}\\s*,') is False:
if config.find_str(cfg_list['file'],
f'\\s*{cfg_list["clk"]}\\s*,') is False:
return (False, 'clk signal in top module dont exist')
else:
return (False, 'dut file dont exist')
Expand Down Expand Up @@ -91,6 +90,10 @@ def check_prog(self, cfg_list: Dict[str, Any]) -> Tuple[bool, str]:
self.sub_cfg.vcs_cfg.prog = (prog['name'], prog['type'])
return (True, 'prog check done with no error')

if prog['name'] == '':
self.sub_cfg.vcs_cfg.prog = ('all', 'all')
return (True, 'prog check done with no error')

return (False, 'prog cfg item value is wrong')

def check_wave(self, cfg_list: Dict[str, Any]) -> Tuple[bool, str]:
Expand Down Expand Up @@ -134,11 +137,13 @@ def check_commit(self, cfg_list: Dict[str, Any]) -> Tuple[bool, str]:
return (False, 'dont have commit cfg item')

# exec git cmd to get commit info
cmd = f'git log origin/{config.BRANCH_NAME_DEV}'
cmd += ' --pretty=format:"%s" -1'
logging.info(msg=cmd)
self.sub_cfg.dut_cfg.commit = config.exec_cmd(cmd)
# cmd = f'git log origin/{config.BRANCH_NAME_DEV}'
# cmd += ' --pretty=format:"%s" -1'
# logging.info(msg=cmd)
# self.sub_cfg.dut_cfg.commit = config.exec_cmd(cmd)
self.sub_cfg.dut_cfg.commit = cfg_list['commit']
logging.info(msg=self.sub_cfg.dut_cfg.commit)
# print(self.sub_cfg.dut_cfg.commit)

# check if git cmd is valid and equal to config toml value
test_list = ['', 'vcs', 'dc']
Expand Down Expand Up @@ -200,12 +205,12 @@ def check_dc(self, cfg_list: Dict[str, Any]) -> Tuple[bool, str]:
def check(self, sid) -> Tuple[bool, str]:
core_dir = config.SUB_DIR + '/' + sid
core_cfg_file = core_dir + '/config.toml'
logging.info(msg=core_cfg_file)
# check if config toml exists
if os.path.isfile(core_cfg_file):
with open(core_cfg_file, 'rb') as fp:
toml_cfg = tomli.load(fp)
logging.info(msg=toml_cfg)

os.chdir(core_dir)
# check and parse config
check_res = self.check_dut(toml_cfg)
Expand Down Expand Up @@ -236,9 +241,9 @@ def main(sid: str) -> Tuple[bool, str]:
if toml_cfg[0]:
logging.info(msg=toml_cfg[1])
else:
logging.warning(msg='config.toml is not found or has some errors')
logging.warning(msg=f'parse config.toml with errors: {toml_cfg[1]}')
return toml_cfg


if __name__ == '__main__':
main('')
main('ysyx_000000')
4 changes: 2 additions & 2 deletions src/repo_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ def check_repo(self, core_info: CoreInfo):
logging.info(msg=f'[{core_info.sid}] first! start pull...')
self.pull_repo(core_info.sid)
self.val_list.append(QueueInfo(core_info.sid, ret[1]))

elif ret[0] is True:
logging.info(msg=f'[{core_info.sid}] changed!! start pull...')
# self.pull_repo(core_info.sid)
self.pull_repo(core_info.sid)
self.val_list.append(QueueInfo(core_info.sid, ret[1]))
else:
logging.info(msg=f'[{core_info.sid}] not changed')
Expand Down

0 comments on commit 889ae1e

Please sign in to comment.