forked from github/verilator
Fix modport outputs being treated as inputs, bug1246.
This commit is contained in:
parent
631bda395d
commit
8f1798cc6f
2
Changes
2
Changes
@ -4,6 +4,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
|
||||
|
||||
* Verilator 3.917 devel
|
||||
|
||||
**** Fix modport outputs being treated as inputs, bug1246. [Jeff Bush]
|
||||
|
||||
|
||||
* Verilator 3.916 2017-11-25
|
||||
|
||||
|
@ -1087,7 +1087,8 @@ modport_itemList<nodep>: // IEEE: part of modport_declaration
|
||||
;
|
||||
|
||||
modport_item<nodep>: // ==IEEE: modport_item
|
||||
id/*new-modport*/ '(' modportPortsDeclList ')' { $$ = new AstModport($2,*$1,$3); }
|
||||
id/*new-modport*/ '(' { VARRESET_NONLIST(UNKNOWN); VARIO(INOUT); }
|
||||
/*cont*/ modportPortsDeclList ')' { $$ = new AstModport($2,*$1,$4); }
|
||||
;
|
||||
|
||||
modportPortsDeclList<nodep>:
|
||||
@ -1113,7 +1114,7 @@ modportPortsDecl<nodep>:
|
||||
| yEXPORT method_prototype { $1->v3error("Unsupported: Modport export with prototype"); }
|
||||
// Continuations of above after a comma.
|
||||
// // IEEE: modport_simple_ports_declaration
|
||||
| modportSimplePort { $$ = new AstModportVarRef($<fl>1,*$1,AstVarType::INOUT); }
|
||||
| modportSimplePort { $$ = new AstModportVarRef($<fl>1,*$1,GRAMMARP->m_varIO); }
|
||||
;
|
||||
|
||||
modportSimplePort<strp>: // IEEE: modport_simple_port or modport_tf_port, depending what keyword was earlier
|
||||
|
18
test_regress/t/t_interface_modportlist.pl
Executable file
18
test_regress/t/t_interface_modportlist.pl
Executable file
@ -0,0 +1,18 @@
|
||||
#!/usr/bin/perl
|
||||
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
|
||||
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||
#
|
||||
# Copyright 2003 by Wilson Snyder. This program is free software; you can
|
||||
# redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
|
||||
compile (
|
||||
fails=>0,
|
||||
verilator_make_gcc => 0,
|
||||
make_top_shell => 0,
|
||||
make_main => 0,
|
||||
);
|
||||
|
||||
ok(1);
|
||||
1;
|
23
test_regress/t/t_interface_modportlist.v
Normal file
23
test_regress/t/t_interface_modportlist.v
Normal file
@ -0,0 +1,23 @@
|
||||
// DESCRIPTION: Verilator: Verilog Test module
|
||||
//
|
||||
// This file ONLY is placed into the Public Domain, for any use,
|
||||
// without warranty, 2016 by Adrian Wise
|
||||
|
||||
//bug1246
|
||||
|
||||
module t(input clk);
|
||||
my_interface iface();
|
||||
my_module m(.clk(clk), iface);
|
||||
endmodule
|
||||
|
||||
module my_module(input clk, my_interface.my_port iface);
|
||||
always @(posedge clk) begin
|
||||
iface.b <= iface.a;
|
||||
iface.c <= iface.a;
|
||||
end
|
||||
endmodule
|
||||
|
||||
interface my_interface;
|
||||
logic a, b, c;
|
||||
modport my_port(input a, output b, c);
|
||||
endinterface
|
Loading…
Reference in New Issue
Block a user