mirror of
https://github.com/Silicon1602/srdl2sv.git
synced 2024-12-22 15:08:39 +00:00
Ensure that file-log gets dumped in --out_dir
This commit is contained in:
parent
7d5ddaf47c
commit
aa770073c4
@ -104,6 +104,12 @@ class CliArguments():
|
||||
config['output_dir'] = args.out_dir
|
||||
config['list_args'].append('Ouput Directory : {}'.format(config['output_dir']))
|
||||
|
||||
# Create output directory
|
||||
try:
|
||||
os.makedirs(config['output_dir'])
|
||||
except FileExistsError:
|
||||
pass
|
||||
|
||||
# Map logging level string to integers
|
||||
config['stream_log_level'] = logging_map[args.stream_log_level]
|
||||
config['file_log_level'] = logging_map[args.file_log_level]
|
||||
@ -125,7 +131,7 @@ class CliArguments():
|
||||
|
||||
# Determine name of file to hold logs
|
||||
ts = time.strftime('%Y%m%d_%H%M%S', config['ts'])
|
||||
config['file_log_location'] = "srdl2sv_{}.log".format(ts)
|
||||
config['file_log_location'] = "/".join([config['output_dir'], "srdl2sv_{}.log".format(ts)])
|
||||
|
||||
# Tab style
|
||||
config['real_tabs'] = args.real_tabs
|
||||
|
@ -47,15 +47,6 @@ if __name__ == "__main__":
|
||||
|
||||
addrmap = AddrMap(root.top, config)
|
||||
|
||||
# Create output directory
|
||||
try:
|
||||
os.makedirs(config['output_dir'])
|
||||
logger.info('Succesfully created directory "{}"'.format(
|
||||
config['output_dir']))
|
||||
except FileExistsError:
|
||||
logger.info('Directory "{}" does already exist'.format(
|
||||
config['output_dir']))
|
||||
|
||||
# Save RTL to file
|
||||
# Start out with addrmap
|
||||
out_addrmap_file = "{}/{}.sv".format(config['output_dir'], addrmap.name)
|
||||
|
Loading…
Reference in New Issue
Block a user