Merge pull request #655 from larsclausen/fix-udp-output-reg

parser: Fix UDP registered output syntax
This commit is contained in:
Stephen Williams 2022-03-20 19:12:34 -07:00 committed by GitHub
commit f73af99ce7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 1 deletions

View File

@ -0,0 +1,37 @@
// Check that it is possible to have a `output reg` in a UDP defintion
module test;
reg clk = 1'b0;
reg d = 1'b0;
wire q;
dff ff(q, clk, d);
initial begin
#1
clk = 1'b1;
#1
clk = 1'b0;
d = 1'b1;
if (q === 1'b0) begin
$display("PASSED");
end else begin
$display("FAILED");
end
end
endmodule
primitive dff(q, c, d);
output reg q;
input c, d;
table
//c d : q : q+
p 0 : ? : 0 ;
p 1 : ? : 1 ;
n ? : ? : - ;
? * : ? : - ;
endtable
endprimitive

View File

@ -1679,6 +1679,7 @@ udp_dff normal ivltests
udp_dff_std normal ivltests
udp_eval_arg normal ivltests
udp_jkff normal ivltests
udp_output_reg normal ivltests
udp_real_delay normal ivltests
udp_sched normal ivltests
udp_x normal ivltests

View File

@ -7007,7 +7007,7 @@ udp_port_decl
$$ = tmp;
delete[]$2;
}
| K_reg K_output IDENTIFIER ';'
| K_output K_reg IDENTIFIER ';'
{ perm_string pname = lex_strings.make($3);
PWire*pp = new PWire(pname, NetNet::REG, NetNet::POUTPUT, IVL_VT_LOGIC);
vector<PWire*>*tmp = new std::vector<PWire*>(1);