3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-11-13 17:41:17 +00:00

add specific package imports and tests

This commit is contained in:
Rahul Bhagwat 2025-11-08 23:05:10 +05:30
parent 5d0847f6fb
commit 224109151d
No known key found for this signature in database
5 changed files with 91 additions and 2 deletions

View file

@ -0,0 +1,14 @@
package package_import_specific;
localparam integer
DATA_WIDTH = 8,
ADDR_WIDTH = 4;
localparam logic [2:0]
IDLE = 3'b000,
START = 3'b001,
DATA = 3'b010,
STOP = 3'b100,
DONE = 3'b101;
endpackage

View file

@ -0,0 +1,5 @@
read_verilog -sv package_import_specific.sv
read_verilog -sv package_import_specific_module.sv
hierarchy -check
proc
opt -full

View file

@ -0,0 +1,16 @@
import package_import_specific::DATA_WIDTH;
import package_import_specific::IDLE;
module package_import_specific_module;
logic [DATA_WIDTH-1:0] data;
logic [3:0] addr;
logic [2:0] state;
always_comb begin
case (state)
IDLE: data = 8'h00;
default: data = 8'hFF;
endcase
end
endmodule