mirror of
https://github.com/YosysHQ/yosys
synced 2025-08-11 13:40:53 +00:00
add separate module test
This commit is contained in:
parent
b776283d79
commit
761015b23e
4 changed files with 54 additions and 3 deletions
13
tests/verilog/package_import_separate.sv
Normal file
13
tests/verilog/package_import_separate.sv
Normal file
|
@ -0,0 +1,13 @@
|
|||
package config_pkg;
|
||||
localparam integer
|
||||
DATA_WIDTH = 8,
|
||||
ADDR_WIDTH = 4;
|
||||
|
||||
localparam logic [2:0]
|
||||
IDLE = 3'b000,
|
||||
START = 3'b001,
|
||||
DATA = 3'b010,
|
||||
ODD_PARITY = 3'b011,
|
||||
STOP = 3'b100,
|
||||
DONE = 3'b101;
|
||||
endpackage
|
5
tests/verilog/package_import_separate.ys
Normal file
5
tests/verilog/package_import_separate.ys
Normal file
|
@ -0,0 +1,5 @@
|
|||
read_verilog -sv package_import_separate.sv
|
||||
read_verilog -sv package_import_separate_module.sv
|
||||
hierarchy -check
|
||||
proc
|
||||
opt -full
|
19
tests/verilog/package_import_separate_module.sv
Normal file
19
tests/verilog/package_import_separate_module.sv
Normal file
|
@ -0,0 +1,19 @@
|
|||
import config_pkg::*;
|
||||
|
||||
module top;
|
||||
logic [DATA_WIDTH-1:0] data;
|
||||
logic [ADDR_WIDTH-1:0] addr;
|
||||
logic [2:0] state;
|
||||
|
||||
always_comb begin
|
||||
case (state)
|
||||
IDLE: data = 8'h00;
|
||||
START: data = 8'h01;
|
||||
DATA: data = 8'h02;
|
||||
ODD_PARITY: data = 8'h03;
|
||||
STOP: data = 8'h04;
|
||||
DONE: data = 8'h05;
|
||||
default: data = 8'hFF;
|
||||
endcase
|
||||
end
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue