Skip to content

Commit aea576a

Browse files
authored
Split blackbox resources into one file per module (#5073)
1 parent 071d801 commit aea576a

14 files changed

+87
-95
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module BlackBoxConstant #(
2+
parameter int WIDTH=1,
3+
parameter int VALUE=1
4+
) (
5+
output [WIDTH-1:0] out
6+
);
7+
assign out = VALUE[WIDTH-1:0];
8+
endmodule
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module BlackBoxInverter(
2+
input [0:0] in,
3+
output [0:0] out
4+
);
5+
assign out = !in;
6+
endmodule
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module BlackBoxMinus(
2+
input [15:0] in1,
3+
input [15:0] in2,
4+
output [15:0] out
5+
);
6+
assign out = in1 + in2;
7+
endmodule
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module BlackBoxPassthrough(
2+
input [0:0] in,
3+
output [0:0] out
4+
);
5+
assign out = in;
6+
endmodule
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module BlackBoxPassthrough2(
2+
input [0:0] in,
3+
output [0:0] out
4+
);
5+
assign out = in;
6+
endmodule
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module BlackBoxRealParam #(
2+
parameter real REAL = 0.0
3+
) (
4+
output [63:0] out
5+
);
6+
assign out = $realtobits(REAL);
7+
endmodule
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module BlackBoxRegister(
2+
input [0:0] clock,
3+
input [0:0] in,
4+
output [0:0] out
5+
);
6+
reg [0:0] register;
7+
always @(posedge clock) begin
8+
register <= in;
9+
end
10+
assign out = register;
11+
endmodule
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module BlackBoxStringParam #(
2+
parameter string STRING = "zero"
3+
) (
4+
output [31:0] out
5+
);
6+
assign out = (STRING == "one" )? 1 :
7+
(STRING == "two" )? 2 : 0;
8+
endmodule

src/test/resources/chisel3/BlackBoxTest.v

Lines changed: 0 additions & 74 deletions
This file was deleted.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module BlackBoxTypeParam #(
2+
parameter type T = bit
3+
) (
4+
output T out
5+
);
6+
assign out = {32'hdeadbeef}[$bits(out)-1:0];
7+
endmodule

0 commit comments

Comments
 (0)