mirror of
https://github.com/YosysHQ/yosys
synced 2025-11-09 15:47:31 +00:00
Merge pull request #4596 from YosysHQ/emil/path-sep-refactor
Refactor getting dirs and filenames from paths to files
This commit is contained in:
commit
52c108cd6a
10 changed files with 64 additions and 30 deletions
2
tests/verilog/.gitignore
vendored
2
tests/verilog/.gitignore
vendored
|
|
@ -4,3 +4,5 @@
|
|||
/roundtrip_proc_1.v
|
||||
/roundtrip_proc_2.v
|
||||
/assign_to_reg.v
|
||||
/subdir
|
||||
/temp_foo.v
|
||||
|
|
|
|||
30
tests/verilog/local_include.sh
Executable file
30
tests/verilog/local_include.sh
Executable file
|
|
@ -0,0 +1,30 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -eu
|
||||
|
||||
# only works with read_verilog
|
||||
yosys='../../yosys -f verilog'
|
||||
test='-p hierarchy'
|
||||
subdir=subdir
|
||||
source=local_include.v
|
||||
include=temp_foo.v
|
||||
|
||||
# no include file should fail
|
||||
rm -f $include
|
||||
echo "logger -expect error $include 1; read_verilog $source" | $yosys
|
||||
|
||||
# both files local
|
||||
echo 'module foo (input a, output b); assign b = a; endmodule' > $include
|
||||
$yosys $test $source
|
||||
|
||||
# include local to cwd
|
||||
mkdir -p $subdir
|
||||
cp $source $subdir
|
||||
$yosys $test $subdir/$source
|
||||
|
||||
# include local to source
|
||||
mv $include $subdir
|
||||
$yosys $test $subdir/$source
|
||||
|
||||
# include local to source, and source is given as an absolute path
|
||||
$yosys $test $(pwd)/$subdir/$source
|
||||
4
tests/verilog/local_include.v
Normal file
4
tests/verilog/local_include.v
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
`include "temp_foo.v"
|
||||
module top (input x, output y);
|
||||
foo bar (.a(x), .b(y));
|
||||
endmodule
|
||||
Loading…
Add table
Add a link
Reference in a new issue