From 822160cc8e76e70643fb56707bb39f6f7526b6fd Mon Sep 17 00:00:00 2001 From: jackkoenig Date: Thu, 22 Sep 2016 22:38:33 -0700 Subject: Add support for parameterized BlackBoxes Also restrict black boxes to not allow hardware inside of them since it was being silently dropped anyway. Resolves #289 --- src/test/resources/BlackBoxTest.v | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/test/resources') diff --git a/src/test/resources/BlackBoxTest.v b/src/test/resources/BlackBoxTest.v index 910b09ff..edf321a8 100644 --- a/src/test/resources/BlackBoxTest.v +++ b/src/test/resources/BlackBoxTest.v @@ -32,3 +32,28 @@ module BlackBoxConstant #( ); assign out = VALUE; endmodule + +module BlackBoxStringParam #( + parameter string STRING = "zero" +) ( + output [31:0] out +); + assign out = (STRING == "one" )? 1 : + (STRING == "two" )? 2 : 0; +endmodule + +module BlackBoxRealParam #( + parameter real REAL = 0.0 +) ( + output [63:0] out +); + assign out = $realtobits(REAL); +endmodule + +module BlackBoxTypeParam #( + parameter type T = bit +) ( + output T out +); + assign out = 32'hdeadbeef; +endmodule -- cgit v1.2.3