opencos-eda 0.3.7__py3-none-any.whl → 0.3.9__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,481 @@
1
+ ''' opencos.tools.questa - Used by opencos.eda for sim/elab commands w/ --tool=questa.
2
+
3
+ Contains classes for ToolQuesta, and CommonSimQuesta.
4
+
5
+ '''
6
+
7
+ # pylint: disable=R0801 # (setting similar, but not identical, self.defines key/value pairs)
8
+
9
+ # TODO(drew): fix these pylint eventually:
10
+ # pylint: disable=too-many-branches
11
+
12
+ import os
13
+ import re
14
+ import shutil
15
+
16
+ from opencos import util
17
+ from opencos.commands import sim, CommandSim, CommandFList
18
+ from opencos.eda_base import Tool
19
+ from opencos.utils.str_helpers import sanitize_defines_for_sh
20
+
21
+ class ToolQuesta(Tool):
22
+ '''Base class for CommandSimQuesta, collects version information about qrun'''
23
+
24
+ _TOOL = 'questa'
25
+ _EXE = 'vsim'
26
+
27
+ starter_edition = False
28
+ use_vopt = shutil.which('vopt') # vopt exists in qrun/vsim framework, and we'll use it.
29
+ sim_exe = '' # vsim or qrun
30
+ sim_exe_base_path = ''
31
+ questa_major = None
32
+ questa_minor = None
33
+
34
+ def __init__(self, config: dict):
35
+ super().__init__(config=config)
36
+ self.args['part'] = 'xcu200-fsgd2104-2-e'
37
+
38
+ def get_versions(self) -> str:
39
+ if self._VERSION:
40
+ return self._VERSION
41
+ path = shutil.which(self._EXE)
42
+ if not path:
43
+ self.error(f"{self._EXE} not in path, need to setup",
44
+ "(i.e. source /opt/intelFPGA_pro/23.4/settings64.sh")
45
+ util.debug(f"{path=}")
46
+ if self._EXE.endswith('qrun') and \
47
+ any(x in path for x in ('modelsim_ase', 'questa_fse')):
48
+ util.warning(f"{self._EXE=} Questa path is for starter edition",
49
+ "(modelsim_ase, questa_fse), consider using --tool=modelsim_ase",
50
+ "or --tool=questa_fse, or similar")
51
+ else:
52
+ self.sim_exe = path
53
+ self.sim_exe_base_path, _ = os.path.split(path)
54
+
55
+ m = re.search(r'(\d+)\.(\d+)', path)
56
+ if m:
57
+ self.questa_major = int(m.group(1))
58
+ self.questa_minor = int(m.group(2))
59
+ self._VERSION = str(self.questa_major) + '.' + str(self.questa_minor)
60
+ else:
61
+ self.error("Questa path doesn't specificy version, expecting (d+.d+)")
62
+ return self._VERSION
63
+
64
+ def set_tool_defines(self):
65
+ # Will only be called from an object which also inherits from CommandDesign,
66
+ # i.e. has self.defines
67
+ self.defines['OC_TOOL_QUESTA'] = None
68
+ self.defines[f'OC_TOOL_QUESTA_{self.questa_major:d}_{self.questa_minor:d}'] = None
69
+
70
+
71
+
72
+ class CommonSimQuesta(CommandSim, ToolQuesta):
73
+ '''CommonSimQuesta is a the base command handler for:
74
+
75
+ eda sim --tool=[modelsim_ase|questa|questa_fse]
76
+ '''
77
+
78
+ def __init__(self, config: dict):
79
+ CommandSim.__init__(self, config=config)
80
+ ToolQuesta.__init__(self, config=self.config)
81
+ self.shell_command = os.path.join(self.sim_exe_base_path, 'vsim')
82
+ self.starter_edition = True
83
+ self.args.update({
84
+ 'tool': self._TOOL, # override
85
+ 'gui': False,
86
+ 'vopt': self.use_vopt,
87
+ })
88
+ self.args_help.update({
89
+ 'vopt': (
90
+ 'Boolean to enable/disable use of vopt step prior to vsim step'
91
+ ' Note that vopt args can be controlled with --elab-args=<value1>'
92
+ ' --elab-args=<value2> ...'
93
+ )
94
+ })
95
+
96
+
97
+ def run_in_batch_mode(self) -> bool:
98
+ '''Returns bool if we should run in batch mode (-c) from command line'''
99
+ if self.args['test-mode']:
100
+ return True
101
+ if self.args['gui']:
102
+ return False
103
+ return True
104
+
105
+
106
+ def prepare_compile(self):
107
+ self.set_tool_defines()
108
+ self.write_vlog_dot_f()
109
+ self.write_vsim_dot_do(dot_do_to_write='all')
110
+
111
+ vsim_command_lists = self.get_compile_command_lists()
112
+ util.write_shell_command_file(
113
+ dirpath=self.args['work-dir'],
114
+ filename='compile_only.sh',
115
+ command_lists=vsim_command_lists
116
+ )
117
+
118
+ vsim_command_lists = self.get_elaborate_command_lists()
119
+ util.write_shell_command_file(
120
+ dirpath=self.args['work-dir'],
121
+ filename='compile_elaborate_only.sh',
122
+ command_lists=vsim_command_lists
123
+ )
124
+
125
+ # Write simulate.sh and all.sh to work-dir:
126
+ vsim_command_lists = self.get_simulate_command_lists()
127
+ self.write_sh_scripts_to_work_dir(
128
+ compile_lists=[], elaborate_lists=[], simulate_lists=vsim_command_lists
129
+ )
130
+
131
+ def compile(self):
132
+ if self.args['stop-before-compile']:
133
+ # don't run anything, save everyting we've already run in _prep_compile()
134
+ return
135
+ if self.args['stop-after-compile']:
136
+ vsim_command_lists = self.get_compile_command_lists()
137
+ self.run_commands_check_logs(vsim_command_lists, log_filename='sim.log',
138
+ must_strings=['Errors: 0'], use_must_strings=False)
139
+
140
+ def elaborate(self):
141
+ if self.args['stop-before-compile']:
142
+ return
143
+ if self.args['stop-after-compile']:
144
+ return
145
+ if self.args['stop-after-elaborate']:
146
+ # only run this if we stop after elaborate (simulate run it all)
147
+ vsim_command_lists = self.get_elaborate_command_lists()
148
+ self.run_commands_check_logs(vsim_command_lists, log_filename='sim.log')
149
+
150
+ def simulate(self):
151
+ if self.args['stop-before-compile'] or self.args['stop-after-compile'] or \
152
+ self.args['stop-after-elaborate']:
153
+ # don't run this if we're stopping before/after compile/elab
154
+ return
155
+ vsim_command_lists = self.get_simulate_command_lists()
156
+ self.run_commands_check_logs(vsim_command_lists, log_filename='sim.log')
157
+
158
+ def get_compile_command_lists(self, **kwargs) -> list:
159
+ # This will also set up a compile.
160
+ vsim_command_list = [
161
+ self.sim_exe,
162
+ '-c' if self.run_in_batch_mode() else '',
163
+ '-do', 'vsim_vlogonly.do', '-logfile', 'sim.log',
164
+ ]
165
+ return [vsim_command_list]
166
+
167
+ def get_elaborate_command_lists(self, **kwargs) -> list:
168
+ # This will also set up a compile, for vlog + vsim (0 time)
169
+ vsim_command_list = [
170
+ self.sim_exe,
171
+ '-c' if self.run_in_batch_mode() else '',
172
+ '-do', 'vsim_lintonly.do', '-logfile', 'sim.log',
173
+ ]
174
+ return [vsim_command_list]
175
+
176
+ def get_simulate_command_lists(self, **kwargs) -> list:
177
+ # This will also set up a compile, for vlog + vsim (with run -a)
178
+ vsim_command_list = [
179
+ self.sim_exe,
180
+ '-c' if self.run_in_batch_mode() else '',
181
+ '-do', 'vsim.do', '-logfile', 'sim.log',
182
+ ]
183
+ return [vsim_command_list]
184
+
185
+ def get_post_simulate_command_lists(self, **kwargs) -> list:
186
+ return []
187
+
188
+ def write_vlog_dot_f(self, filename='vlog.f') -> None:
189
+ '''Returns none, creates filename (str) for a vlog.f'''
190
+ vlog_dot_f_lines = []
191
+
192
+ # Add compile args from config.tool.TOOL (questa, etc):
193
+ vlog_dot_f_lines += self.tool_config.get(
194
+ 'compile-args',
195
+ '-sv -svinputport=net -lint').split()
196
+ # Add waivers from config.tool.TOOL (questa, modelsim_ase, etc)
197
+ for waiver in self.tool_config.get(
198
+ 'compile-waivers',
199
+ [ #defaults:
200
+ '2275', # 2275 - Existing package 'foo_pkg' will be overwritten.
201
+ ]) + self.args['compile-waivers']:
202
+ vlog_dot_f_lines += ['-suppress', str(waiver)]
203
+
204
+ if self.args['gui'] or self.args['waves']:
205
+ vlog_dot_f_lines += self.tool_config.get('compile-waves-args', '').split()
206
+
207
+ vlog_dot_f_fname = filename
208
+ vlog_dot_f_fpath = os.path.join(self.args['work-dir'], vlog_dot_f_fname)
209
+
210
+ for value in self.incdirs:
211
+ vlog_dot_f_lines += [ f"+incdir+{value}" ]
212
+
213
+ for k,v in self.defines.items():
214
+ if v is None:
215
+ vlog_dot_f_lines += [ f'+define+{k}' ]
216
+ else:
217
+
218
+ # if the value v is a double-quoted string, such as v='"hi"', the
219
+ # entire +define+NAME="hi" needs to wrapped in double quotes with the
220
+ # value v double-quotes escaped: "+define+NAME=\"hi\""
221
+ if isinstance(v, str) and v.startswith('"') and v.endswith('"'):
222
+ str_v = v.replace('"', '\\"')
223
+ vlog_dot_f_lines += [ f'"+define+{k}={str_v}"' ]
224
+ else:
225
+ # Generally we should only support int and str python types passed as
226
+ # +define+{k}={v}, but also for SystemVerilog plusargs
227
+ vlog_dot_f_lines += [ f'+define+{k}={sanitize_defines_for_sh(v)}' ]
228
+
229
+
230
+ vlog_dot_f_lines += self.args['compile-args']
231
+
232
+ vlog_dot_f_lines += [
233
+ '-source',
234
+ ] + list(self.files_sv) + list(self.files_v)
235
+
236
+ if not self.files_sv and not self.files_v:
237
+ if not self.args['stop-before-compile']:
238
+ self.error(f'{self.target=} {self.files_sv=} and {self.files_v=} are empty,',
239
+ 'cannot create a valid vlog.f')
240
+
241
+ with open(vlog_dot_f_fpath, 'w', encoding='utf-8') as f:
242
+ f.writelines(line + "\n" for line in vlog_dot_f_lines)
243
+
244
+ def vopt_handle_parameters(self) -> (str, list):
245
+ '''Returns str for vopt or voptargs, and list of vopt tcl
246
+
247
+ Note this is used for self.use_vopt = True or False.
248
+ '''
249
+
250
+ voptargs_str = ''
251
+ vopt_do_lines = []
252
+
253
+ # Note that if self.use_vopt=True, we have to do some workarounds for how
254
+ # some questa-like tools behave for: tcl/.do + vopt arg processing
255
+ # This affects string based parameters that have spaces (vopt treats spaces unique args,
256
+ # vsim does not). Since we'd like to keep the vopt/vsim split into separate steps, we can
257
+ # work around this by setting tcl varaibles for each parameter.
258
+ if self.parameters:
259
+ if not self.use_vopt:
260
+ voptargs_str += ' ' + ' '.join(self.process_parameters_get_list(arg_prefix='-G'))
261
+ else:
262
+ for k,v in self.parameters.items():
263
+ s = sim.parameters_dict_get_command_list(params={k: v}, arg_prefix='')[0]
264
+ # At this point, s should be a str in form {k}={v}
265
+ if not s or '=' not in s:
266
+ continue
267
+ if ' ' in s:
268
+ # Instead of:
269
+ # vopt -GMyParam="hi bye"
270
+ # we'll do:
271
+ # set PARAMETERS(MyParam) "hi bye"
272
+ # vopt -GMyParam=$PARAMETERS(MyParam)
273
+ s = s.replace(f'{k}=', f'set PARAMETERS({k}) ')
274
+ vopt_do_lines.append(s)
275
+ voptargs_str += f' -G{k}=$PARAMETERS({k}) '
276
+ else:
277
+ voptargs_str += f' -G{s} '
278
+
279
+ return voptargs_str, vopt_do_lines
280
+
281
+
282
+ def write_vsim_dot_do( # pylint: disable=too-many-locals
283
+ self, dot_do_to_write: list
284
+ ) -> None:
285
+ '''Writes files(s) based on dot_do_to_write(list of str)
286
+
287
+ list arg values can be empty (all) or have items 'all', 'sim', 'lint', 'vlog'.'''
288
+
289
+ vsim_dot_do_fpath = os.path.join(self.args['work-dir'], 'vsim.do')
290
+ vsim_lintonly_dot_do_fpath = os.path.join(self.args['work-dir'], 'vsim_lintonly.do')
291
+ vsim_vlogonly_dot_do_fpath = os.path.join(self.args['work-dir'], 'vsim_vlogonly.do')
292
+
293
+ sim_plusargs_str = self._get_sim_plusargs_str()
294
+ vsim_suppress_list_str = self._get_vsim_suppress_list_str()
295
+ vsim_ext_args = ' '.join(self.args.get('sim-args', []))
296
+
297
+ voptargs_str = self.tool_config.get('elab-args', '')
298
+ voptargs_str += ' '.join(self.args.get('elab-args', []))
299
+ if self.args['gui'] or self.args['waves']:
300
+ voptargs_str += ' ' + self.tool_config.get('simulate-waves-args', '+acc')
301
+ util.artifacts.add_extension(
302
+ search_paths=self.args['work-dir'], file_extension='wlf',
303
+ typ='waveform', description='Modelsim/Questa Waveform WLF (Wave Log Format) file'
304
+ )
305
+
306
+ # TODO(drew): support self.args['sim_libary'] (1 lists)
307
+ vlog_do_lines = []
308
+ vsim_do_lines = []
309
+
310
+ # parameters, use helper method to get voptargs_str and vopt_do_lines
311
+ more_voptargs_str, vopt_do_lines = self.vopt_handle_parameters()
312
+ voptargs_str += more_voptargs_str
313
+
314
+
315
+ vopt_one_liner = ""
316
+ if self.use_vopt:
317
+ vopt_one_liner = (
318
+ f"vopt {voptargs_str} work.{self.args['top']} -o opt__{self.args['top']}"
319
+ )
320
+ vopt_one_liner = vopt_one_liner.replace('\n', ' ') # needs to be a one-liner
321
+ # vopt doesn't need -voptargs=(value) like vsim does, simply use (value).
322
+ vopt_one_liner = vopt_one_liner.replace('-voptargs=', '')
323
+
324
+ vsim_one_liner = "vsim -onfinish stop" \
325
+ + f" -sv_seed {self.args['seed']} {sim_plusargs_str} {vsim_suppress_list_str}" \
326
+ + f" {vsim_ext_args} opt__{self.args['top']}"
327
+ else:
328
+ # vopt doesn't exist, use single vsim call after vlog call:
329
+ vsim_one_liner = "vsim -onfinish stop" \
330
+ + f" -sv_seed {self.args['seed']} {sim_plusargs_str} {vsim_suppress_list_str}" \
331
+ + f" {voptargs_str} {vsim_ext_args} work.{self.args['top']}"
332
+
333
+
334
+ vsim_one_liner = vsim_one_liner.replace('\n', ' ')
335
+
336
+ vlog_do_lines += [
337
+ "if {[file exists work]} { vdel -all work; }",
338
+ "vlib work;",
339
+ "quietly set qc 30;",
340
+ "if {[catch {vlog -f vlog.f} result]} {",
341
+ " echo \"Caught $result \";",
342
+ " if {[batch_mode]} {",
343
+ " quit -f -code 20;",
344
+ " }",
345
+ "}",
346
+ ]
347
+
348
+ if self.use_vopt:
349
+ vopt_do_lines += [
350
+ "if {[catch { " + vopt_one_liner + " } result] } {",
351
+ " echo \"Caught $result\";",
352
+ " if {[batch_mode]} {",
353
+ " quit -f -code 19;",
354
+ " }",
355
+ "}",
356
+ ]
357
+
358
+ vsim_do_lines += [
359
+ "if {[catch { " + vsim_one_liner + " } result] } {",
360
+ " echo \"Caught $result\";",
361
+ " if {[batch_mode]} {",
362
+ " quit -f -code 18;",
363
+ " }",
364
+ "}",
365
+ ]
366
+
367
+ vsim_vlogonly_dot_do_lines = vlog_do_lines + [
368
+ "if {[batch_mode]} {",
369
+ " quit -f -code 0;",
370
+ "}",
371
+ ]
372
+
373
+ final_check_teststatus_do_lines = [
374
+ "set TestStatus [coverage attribute -name SEED -name TESTSTATUS];",
375
+ "if {[regexp \"TESTSTATUS += 0\" $TestStatus]} {",
376
+ " quietly set qc 0;",
377
+ "} elseif {[regexp \"TESTSTATUS += 1\" $TestStatus]} {",
378
+ " quietly set qc 0;",
379
+ "} else {",
380
+ " quietly set qc 2;",
381
+ "}",
382
+ "if {[batch_mode]} {",
383
+ " quit -f -code $qc;",
384
+ "}",
385
+ ]
386
+
387
+ # final vlog/vopt/vsim lint-only .do command (want to make sure it can completely
388
+ # build for 'elab' style eda job), runs for 0ns, logs nothing for a waveform, quits
389
+ vsim_lintonly_dot_do_lines = vlog_do_lines + vopt_do_lines + vsim_do_lines \
390
+ + final_check_teststatus_do_lines
391
+
392
+ # final vlog/opt/vsim full simulation .do command.
393
+ vsim_dot_do_lines = vlog_do_lines + vopt_do_lines + vsim_do_lines + [
394
+ "onbreak { resume; };",
395
+ "catch {log -r *};",
396
+ "run -a;",
397
+ ] + final_check_teststatus_do_lines
398
+
399
+ write_all = len(dot_do_to_write) == 0 or 'all' in dot_do_to_write
400
+ if write_all or 'sim' in dot_do_to_write:
401
+ with open(vsim_dot_do_fpath, 'w', encoding='utf-8') as f:
402
+ f.writelines(line + "\n" for line in vsim_dot_do_lines)
403
+
404
+ if write_all or 'lint' in dot_do_to_write:
405
+ with open(vsim_lintonly_dot_do_fpath, 'w', encoding='utf-8') as f:
406
+ f.writelines(line + "\n" for line in vsim_lintonly_dot_do_lines)
407
+
408
+ if write_all or 'vlog' in dot_do_to_write:
409
+ with open(vsim_vlogonly_dot_do_fpath, 'w', encoding='utf-8') as f:
410
+ f.writelines(line + "\n" for line in vsim_vlogonly_dot_do_lines)
411
+
412
+
413
+ def _get_sim_plusargs_str(self) -> str:
414
+ sim_plusargs = []
415
+
416
+ assert isinstance(self.args["sim-plusargs"], list), \
417
+ f'{self.target=} {type(self.args["sim-plusargs"])=} but must be list'
418
+
419
+ for x in self.args['sim-plusargs']:
420
+ # For vsim we need to add a +key=value if the + is missing
421
+ if x[0] != '+':
422
+ x = f'+{x}'
423
+ sim_plusargs.append(x)
424
+
425
+ return ' '.join(sim_plusargs)
426
+
427
+
428
+ def _get_vsim_suppress_list_str(self) -> str:
429
+ vsim_suppress_list = []
430
+ # Add waivers from config.tool.TOOL:
431
+ for waiver in self.tool_config.get(
432
+ 'simulate-waivers', [
433
+ #defaults:
434
+ '3009', # 3009: [TSCALE] - Module 'foo' does not have a timeunit/timeprecision
435
+ # specification in effect, but other modules do.
436
+ ]) + self.args['sim-waivers']:
437
+ vsim_suppress_list += ['-suppress', str(waiver)]
438
+
439
+ return ' '.join(vsim_suppress_list)
440
+
441
+
442
+ def artifacts_add(self, name: str, typ: str, description: str) -> None:
443
+ '''Override from Command.artifacts_add, so we can catch known file
444
+
445
+ names to make their typ/description better, such as CommandSim using
446
+ sim.log
447
+ '''
448
+ _, leafname = os.path.split(name)
449
+ if leafname == 'sim.log':
450
+ description = 'Modelsim/Questa Transcript log file'
451
+
452
+ super().artifacts_add(name=name, typ=typ, description=description)
453
+
454
+
455
+ class CommonElabQuesta(CommonSimQuesta):
456
+ '''CommonElabQuesta is a command handler for: eda elab --tool=(questa family)'''
457
+
458
+ command_name = 'elab'
459
+
460
+ def __init__(self, config:dict):
461
+ super().__init__(config)
462
+ self.args['stop-after-elaborate'] = True
463
+
464
+
465
+ class CommonLintQuesta(CommonSimQuesta):
466
+ '''CommonSimQuesta is a command handler for: eda lint --tool=(questa family)'''
467
+
468
+ command_name = 'lint'
469
+
470
+ def __init__(self, config:dict):
471
+ super().__init__(config)
472
+ self.args['stop-after-compile'] = True
473
+ self.args['stop-after-elaborate'] = True
474
+
475
+
476
+ class CommonFListQuesta(CommandFList, ToolQuesta):
477
+ '''CommonFListQuesta is a command handler for: eda flist --tool=(questa family)'''
478
+
479
+ def __init__(self, config: dict):
480
+ CommandFList.__init__(self, config=config)
481
+ ToolQuesta.__init__(self, config=self.config)
@@ -0,0 +1,84 @@
1
+ ''' opencos.tools.questa - Used by opencos.eda for sim/elab commands w/ --tool=questa.
2
+
3
+ Contains classes for CommandSimQuesta, CommandElabQuesta.
4
+ For: Questa Intel (FPGA) Edition-64 vsim 20XX.X Simulator
5
+
6
+ Note - NOT the starter edition (see questa_fse.py)
7
+
8
+ '''
9
+
10
+ # pylint: disable=R0801 # (setting similar, but not identical, self.defines key/value pairs)
11
+
12
+ # TODO(drew): fix these pylint eventually:
13
+ # pylint: disable=too-many-branches, too-many-ancestors
14
+
15
+ import os
16
+
17
+ from opencos.tools.questa_common import CommonSimQuesta, CommonFListQuesta
18
+
19
+
20
+ class CommandSimQuestaFe(CommonSimQuesta):
21
+ '''CommandSimQuestaFe is a command handler for: eda sim --tool=questa_fe
22
+
23
+ Note this inherits 99% from CommonSimQuesta for command handling
24
+ '''
25
+ _TOOL = 'questa_fe'
26
+ _EXE = 'vsim'
27
+ use_vopt = True
28
+
29
+ def __init__(self, config: dict):
30
+ # this will setup with self._TOOL = questa, optionally repair it later
31
+ CommonSimQuesta.__init__(self, config=config)
32
+
33
+ # repairs: override self._TOOL, and run get_versions() again.
34
+ self._TOOL = 'questa_fe'
35
+
36
+ self.shell_command = os.path.join(self.sim_exe_base_path, 'vsim')
37
+ self.starter_edition = False
38
+ self.args.update({
39
+ 'tool': self._TOOL, # override
40
+ 'gui': False,
41
+ })
42
+
43
+
44
+ def set_tool_defines(self):
45
+ '''Override from questa.ToolQuesta'''
46
+ # Update any defines from config.tools.questa_fse:
47
+ self.defines.update(
48
+ self.tool_config.get(
49
+ 'defines',
50
+ # defaults, if not set:
51
+ {
52
+ 'OC_TOOL_QUESTA_FE': 1
53
+ }
54
+ )
55
+ )
56
+
57
+
58
+ class CommandElabQuestaFe(CommandSimQuestaFe):
59
+ '''CommandElabQuesta is a command handler for: eda elab --tool=questa_fe'''
60
+
61
+ command_name = 'elab'
62
+
63
+ def __init__(self, config:dict):
64
+ super().__init__(config)
65
+ self.args['stop-after-elaborate'] = True
66
+
67
+
68
+ class CommandLintQuestaFe(CommandSimQuestaFe):
69
+ '''CommandLintQuesta is a command handler for: eda lint --tool=questa_fe'''
70
+
71
+ command_name = 'lint'
72
+
73
+ def __init__(self, config:dict):
74
+ super().__init__(config)
75
+ self.args['stop-after-compile'] = True
76
+ self.args['stop-after-elaborate'] = True
77
+
78
+
79
+ class CommandFListQuestaFe(CommonFListQuesta):
80
+ '''CommandFListQuesta is a command handler for: eda flist --tool=questa'''
81
+
82
+ def __init__(self, config: dict):
83
+ CommonFListQuesta.__init__(self, config=config)
84
+ self._TOOL = 'questa_fse'
@@ -10,23 +10,22 @@ For: Questa Intel Starter FPGA Edition-64 vsim 20XX.X Simulator
10
10
 
11
11
  import os
12
12
 
13
- from opencos.tools.modelsim_ase import CommandSimModelsimAse
14
- from opencos.tools.questa import CommandFListQuesta
13
+ from opencos.tools.questa_common import CommonSimQuesta, CommonFListQuesta
15
14
 
16
15
 
17
- class CommandSimQuestaFse(CommandSimModelsimAse):
16
+ class CommandSimQuestaFse(CommonSimQuesta):
18
17
  '''CommandSimQuestaFse is a command handler for: eda sim --tool=questa_fse
19
18
 
20
- Note this inherits 99% from CommandSimModelSimAse for command handling
19
+ Note this inherits 99% from CommonSimQuesta for command handling
21
20
  '''
22
21
  _TOOL = 'questa_fse'
23
22
  _EXE = 'vsim'
24
23
  use_vopt = True
25
24
 
26
25
  def __init__(self, config: dict):
27
- # this will setup with self._TOOL = modelsim_ase, which is not ideal so
26
+ # this will setup with self._TOOL = questa, which is not ideal so
28
27
  # we have to repait it later.
29
- CommandSimModelsimAse.__init__(self, config=config)
28
+ CommonSimQuesta.__init__(self, config=config)
30
29
 
31
30
  # repairs: override self._TOOL, and run get_versions() again.
32
31
  self._TOOL = 'questa_fse'
@@ -74,9 +73,9 @@ class CommandLintQuestaFse(CommandSimQuestaFse):
74
73
  self.args['stop-after-elaborate'] = True
75
74
 
76
75
 
77
- class CommandFListQuestaFse(CommandFListQuesta):
76
+ class CommandFListQuestaFse(CommonFListQuesta):
78
77
  '''CommandFListQuestaFse is a command handler for: eda flist --tool=questa_fse'''
79
78
 
80
79
  def __init__(self, config: dict):
81
- CommandFListQuesta.__init__(self, config=config)
80
+ CommonFListQuesta.__init__(self, config=config)
82
81
  self._TOOL = 'questa_fse'