forked from github/verilator
Fix false unused message on __Vemumtab, msg3180.
This commit is contained in:
parent
00979ede14
commit
b0669f3aca
2
Changes
2
Changes
@ -34,6 +34,8 @@ The contributors that suggested a given feature are shown in []. Thanks!
|
|||||||
|
|
||||||
**** Fix labels on functions with returns, bug1614. [Mitch Hayenga]
|
**** Fix labels on functions with returns, bug1614. [Mitch Hayenga]
|
||||||
|
|
||||||
|
**** Fix false unused message on __Vemumtab, msg3180. [Tobias Rosenkranz]
|
||||||
|
|
||||||
|
|
||||||
* Verilator 4.022 2019-11-10
|
* Verilator 4.022 2019-11-10
|
||||||
|
|
||||||
|
@ -292,6 +292,9 @@ private:
|
|||||||
|| (m_taskp && (m_taskp->dpiImport() || m_taskp->dpiExport()))) {
|
|| (m_taskp && (m_taskp->dpiImport() || m_taskp->dpiExport()))) {
|
||||||
entryp->usedWhole();
|
entryp->usedWhole();
|
||||||
}
|
}
|
||||||
|
if (nodep->valuep()) {
|
||||||
|
entryp->drivenWhole();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Discover variables used in bit definitions, etc
|
// Discover variables used in bit definitions, etc
|
||||||
iterateChildren(nodep);
|
iterateChildren(nodep);
|
||||||
|
17
test_regress/t/t_bug3180.pl
Executable file
17
test_regress/t/t_bug3180.pl
Executable file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/perl
|
||||||
|
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
|
||||||
|
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||||
|
#
|
||||||
|
# Copyright 2019 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.
|
||||||
|
|
||||||
|
scenarios(simulator => 1);
|
||||||
|
|
||||||
|
compile(
|
||||||
|
verilator_flags2 => ['-Wall -Wno-DECLFILENAME --coverage-line'],
|
||||||
|
);
|
||||||
|
|
||||||
|
ok(1);
|
||||||
|
1;
|
51
test_regress/t/t_bug3180.v
Normal file
51
test_regress/t/t_bug3180.v
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
// DESCRIPTION: Verilator: Verilog Test module
|
||||||
|
//
|
||||||
|
// This file ONLY is placed into the Public Domain, for any use,
|
||||||
|
// without warranty, 2019 by Wilson Snyder.
|
||||||
|
|
||||||
|
module t
|
||||||
|
(/*AUTOARG*/
|
||||||
|
// Outputs
|
||||||
|
someOutput,
|
||||||
|
// Inputs
|
||||||
|
clk, reset_l, InOne, InTwo
|
||||||
|
);
|
||||||
|
|
||||||
|
input clk;
|
||||||
|
input reset_l;
|
||||||
|
input InOne, InTwo;
|
||||||
|
output logic someOutput;
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
STATE_ONE,
|
||||||
|
STATE_TWO,
|
||||||
|
STATE_THREE,
|
||||||
|
STATE_FOUR
|
||||||
|
} some_state_t;
|
||||||
|
|
||||||
|
some_state_t some_FSM;
|
||||||
|
|
||||||
|
always_ff @ (posedge clk or negedge reset_l) begin
|
||||||
|
if(!reset_l)
|
||||||
|
some_FSM <= some_FSM.first;
|
||||||
|
else begin
|
||||||
|
unique case (some_FSM)
|
||||||
|
STATE_ONE, STATE_TWO, STATE_THREE: begin
|
||||||
|
if(InOne & InTwo)
|
||||||
|
some_FSM <= some_FSM.next;
|
||||||
|
else if(InOne)
|
||||||
|
some_FSM <= some_FSM;
|
||||||
|
else
|
||||||
|
some_FSM <= some_FSM.first;
|
||||||
|
end
|
||||||
|
default: begin
|
||||||
|
some_FSM <= STATE_ONE;
|
||||||
|
end
|
||||||
|
endcase
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
always_comb begin
|
||||||
|
someOutput = (some_FSM == STATE_FOUR);
|
||||||
|
end
|
||||||
|
endmodule
|
Loading…
Reference in New Issue
Block a user