mirror of https://github.com/YosysHQ/yosys.git
Merge pull request #1013 from antmicro/parameter_attributes
Support for attributes on parameters and localparams for Verilog frontend
This commit is contained in:
commit
b6345b111d
|
@ -1202,7 +1202,7 @@ param_range:
|
||||||
};
|
};
|
||||||
|
|
||||||
param_decl:
|
param_decl:
|
||||||
TOK_PARAMETER {
|
attr TOK_PARAMETER {
|
||||||
astbuf1 = new AstNode(AST_PARAMETER);
|
astbuf1 = new AstNode(AST_PARAMETER);
|
||||||
astbuf1->children.push_back(AstNode::mkconst_int(0, true));
|
astbuf1->children.push_back(AstNode::mkconst_int(0, true));
|
||||||
} param_signed param_integer param_real param_range param_decl_list ';' {
|
} param_signed param_integer param_real param_range param_decl_list ';' {
|
||||||
|
@ -1210,7 +1210,7 @@ param_decl:
|
||||||
};
|
};
|
||||||
|
|
||||||
localparam_decl:
|
localparam_decl:
|
||||||
TOK_LOCALPARAM {
|
attr TOK_LOCALPARAM {
|
||||||
astbuf1 = new AstNode(AST_LOCALPARAM);
|
astbuf1 = new AstNode(AST_LOCALPARAM);
|
||||||
astbuf1->children.push_back(AstNode::mkconst_int(0, true));
|
astbuf1->children.push_back(AstNode::mkconst_int(0, true));
|
||||||
} param_signed param_integer param_real param_range param_decl_list ';' {
|
} param_signed param_integer param_real param_range param_decl_list ';' {
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
module uut_localparam_attr (I, O);
|
||||||
|
|
||||||
|
(* LOCALPARAM_ATTRIBUTE = "attribute_content" *)
|
||||||
|
localparam WIDTH = 1;
|
||||||
|
|
||||||
|
input wire [WIDTH-1:0] I;
|
||||||
|
output wire [WIDTH-1:0] O;
|
||||||
|
|
||||||
|
assign O = I;
|
||||||
|
|
||||||
|
endmodule
|
|
@ -0,0 +1,11 @@
|
||||||
|
module uut_param_attr (I, O);
|
||||||
|
|
||||||
|
(* PARAMETER_ATTRIBUTE = "attribute_content" *)
|
||||||
|
parameter WIDTH = 1;
|
||||||
|
|
||||||
|
input wire [WIDTH-1:0] I;
|
||||||
|
output wire [WIDTH-1:0] O;
|
||||||
|
|
||||||
|
assign O = I;
|
||||||
|
|
||||||
|
endmodule
|
Loading…
Reference in New Issue