2019-02-19 16:35:15 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Simple test of hierarchy -auto-top.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2019-02-22 18:06:10 -06:00
|
|
|
echo -n " TOP first - "
|
|
|
|
../../yosys -s - <<- EOY | grep "Automatically selected TOP as design top module"
|
2019-02-19 16:35:15 -06:00
|
|
|
read_verilog << EOV
|
|
|
|
module TOP(a, y);
|
|
|
|
input a;
|
|
|
|
output [31:0] y;
|
|
|
|
|
|
|
|
aoi12 p [31:0] (a, y);
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module aoi12(a, y);
|
|
|
|
input a;
|
|
|
|
output y;
|
|
|
|
assign y = ~a;
|
|
|
|
endmodule
|
|
|
|
EOV
|
|
|
|
hierarchy -auto-top
|
|
|
|
EOY
|
|
|
|
|
2019-02-22 18:06:10 -06:00
|
|
|
echo -n " TOP last - "
|
|
|
|
../../yosys -s - <<- EOY | grep "Automatically selected TOP as design top module"
|
2019-02-19 16:35:15 -06:00
|
|
|
read_verilog << EOV
|
|
|
|
module aoi12(a, y);
|
|
|
|
input a;
|
|
|
|
output y;
|
|
|
|
assign y = ~a;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module TOP(a, y);
|
|
|
|
input a;
|
|
|
|
output [31:0] y;
|
|
|
|
|
|
|
|
aoi12 foo (a, y);
|
|
|
|
endmodule
|
|
|
|
EOV
|
|
|
|
hierarchy -auto-top
|
|
|
|
EOY
|
|
|
|
|
2019-02-22 18:06:10 -06:00
|
|
|
echo -n " no explicit top - "
|
|
|
|
../../yosys -s - <<- EOY | grep "Automatically selected noTop as design top module."
|
2019-02-19 16:35:15 -06:00
|
|
|
read_verilog << EOV
|
|
|
|
module aoi12(a, y);
|
|
|
|
input a;
|
|
|
|
output y;
|
|
|
|
assign y = ~a;
|
|
|
|
endmodule
|
|
|
|
|
|
|
|
module noTop(a, y);
|
|
|
|
input a;
|
|
|
|
output [31:0] y;
|
2019-04-21 04:40:20 -05:00
|
|
|
assign y = a;
|
2019-02-19 16:35:15 -06:00
|
|
|
endmodule
|
|
|
|
EOV
|
|
|
|
hierarchy -auto-top
|
|
|
|
EOY
|