-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env python | ||
import os | ||
import sys | ||
|
||
output_file = sys.argv[sys.argv.index('-o')+1] | ||
|
||
with open(output_file, 'w') as f: | ||
s = """#!/usr/bin/env python | ||
import sys | ||
with open('run.cmd', 'w') as f: | ||
f.write(' '.join(sys.argv[1:]) + '\\n') | ||
""" | ||
f.write(s) | ||
os.chmod(output_file, 0o755) | ||
|
||
with open('vcs.cmd', 'w') as f: | ||
f.write(' '.join(sys.argv[1:]) + '\n') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import pytest | ||
|
||
def test_vcs2(): | ||
import os | ||
import shutil | ||
from edalize_common import compare_files, setup_backend, tests_dir | ||
|
||
ref_dir = os.path.join(tests_dir, __name__) | ||
paramtypes = ['plusarg', 'vlogdefine', 'vlogparam'] | ||
name = 'test_vcs_0' | ||
tool = 'vcs' | ||
tool_options = {} | ||
# tool_options = { | ||
# 'iverilog_options' : ['some', 'iverilog_options'], | ||
# 'timescale' : '1ns/1ns', | ||
# } | ||
|
||
(backend, args, work_root) = setup_backend(paramtypes, name, tool, tool_options, use_vpi=False) | ||
backend.configure(args) | ||
|
||
compare_files(ref_dir, work_root, ['Makefile', | ||
name+'.scr', | ||
]) | ||
|
||
backend.build() | ||
compare_files(ref_dir, work_root, ['vcs.cmd']) | ||
|
||
backend.run(args) | ||
|
||
compare_files(ref_dir, work_root, ['run.cmd']) | ||
|
||
def test_vcs_minimal(): | ||
import os | ||
import shutil | ||
import tempfile | ||
|
||
from edalize import get_edatool | ||
|
||
from edalize_common import compare_files, tests_dir | ||
|
||
ref_dir = os.path.join(tests_dir, __name__, 'minimal') | ||
os.environ['PATH'] = os.path.join(tests_dir, 'mock_commands')+':'+os.environ['PATH'] | ||
tool = 'vcs' | ||
name = 'test_'+tool+'_minimal_0' | ||
work_root = tempfile.mkdtemp(prefix=tool+'_') | ||
|
||
edam = {'name' : name, | ||
'toplevel' : 'top'} | ||
|
||
backend = get_edatool(tool)(edam=edam, work_root=work_root) | ||
backend.configure([]) | ||
|
||
compare_files(ref_dir, work_root, ['Makefile', | ||
name+'.scr', | ||
]) | ||
|
||
backend.build() | ||
compare_files(ref_dir, work_root, ['vcs.cmd']) | ||
|
||
backend.run([]) | ||
|
||
compare_files(ref_dir, work_root, ['run.cmd']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
all: test_vcs_0 | ||
|
||
test_vcs_0: test_vcs_0.scr | ||
vcs -full64 -t top_module -f test_vcs_0.scr -o $@ | ||
run: test_vcs_0 | ||
./test_vcs_0 -l vcs.log +plusarg_bool=1 +plusarg_int=42 +plusarg_str=hello | ||
clean: | ||
$(RM) test_vcs_0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
all: test_vcs_minimal_0 | ||
|
||
test_vcs_minimal_0: test_vcs_minimal_0.scr | ||
vcs -full64 -t top -f test_vcs_minimal_0.scr -o $@ | ||
run: test_vcs_minimal_0 | ||
./test_vcs_minimal_0 -l vcs.log | ||
clean: | ||
$(RM) test_vcs_minimal_0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-l vcs.log |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-full64 -t top -f test_vcs_minimal_0.scr -o test_vcs_minimal_0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-l vcs.log +plusarg_bool=1 +plusarg_int=42 +plusarg_str=hello |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
+define+vlogdefine_bool=1 | ||
+define+vlogdefine_int=42 | ||
+define+vlogdefine_str=hello | ||
+parameter+top_module.vlogparam_bool=1 | ||
+parameter+top_module.vlogparam_int=42 | ||
+parameter+top_module.vlogparam_str="hello" | ||
+incdir+. | ||
sv_file.sv | ||
vlog_file.v | ||
vlog05_file.v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-full64 -t top_module -f test_vcs_0.scr -o test_vcs_0 |