You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are trying to simulate some simple clockgating blocks that are in verilog. The rest of the design is vhdl.
These seem trivial to convert to VHDL, but the clockgating introduces deltacycle delays on the gated clock.
The design has some signals passing from the non-gated to the gated domain clock, which would skip a cycle when we converted the module to vhdl. At least with modelsim the CLK and GCLK would allign on the same deltacycle.
moduleclk_gate_p (
CLK,
E,
GCLK,
SE
);
input CLK;
input E;
input SE;
output GCLK;
wire CLK;
wire E;
wire SE;
wire GCLK;
reg en1;
always @ (CLK or E or SE) beginif (CLK ==0)
en1 = SE | E;
endassign GCLK = CLK & en1;
endmodule
moduleclk_gate_n (
CLK,
E,
GCLK,
SE
);
input CLK;
input E;
input SE;
output GCLK;
wire CLK;
wire E;
wire SE;
wire GCLK;
reg en1;
always @ (CLK or E or SE) beginif (CLK ==1)
en1 = SE | E;
endassign GCLK = CLK |!en1;
endmodule
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entitytestisendentity;
architecturearchoftestiscomponentclk_gate_pisport (
CLK : instd_logic;
E : instd_logic;
GCLK : instd_logic;
SE : instd_logic);
endcomponent;
componentclk_gate_nisport (
CLK : instd_logic;
E : instd_logic;
GCLK : instd_logic;
SE : instd_logic);
endcomponent;
signal CLK, SE, E, GCLK_p, GCLK_n : std_logic;
beginu0 : clk_gate_pportmap (
CLK => clk,
E => e,
GCLK => gclk_p,
SE => se);
u1 : clk_gate_nportmap (
CLK => clk,
E => e,
GCLK => gclk_n,
SE => se);
se <='0';
processisbegin
CLK <='0';
E <='0';
waitfor1ps;
CLK <='1';
waitfor1ps;
assert gclk_p ='0'report"p 1"severityfailure;
assert gclk_n ='1'report"n 1"severityfailure;
CLK <='0';
waitfor1ps;
assert gclk_p ='0'report"p 2"severityfailure;
assert gclk_n ='1'report"n 2"severityfailure;
E <='1';
waitfor1ps;
assert gclk_p ='0'report"p 3"severityfailure;
assert gclk_n ='1'report"n 3"severityfailure;
CLK <='1';
waitfor1ps;
assert gclk_p ='1'report"p 4"severityfailure;
assert gclk_n ='1'report"n 4"severityfailure;
CLK <='0';
waitfor1ps;
assert gclk_p ='0'report"p 5"severityfailure;
assert gclk_n ='0'report"n 5"severityfailure;
wait;
endprocess;
endarchitecture;
$ nvc -a clk_gate_n.v
$ nvc -a clk_gate_p.v
$ nvc --std=08 -a test.vhd
$ nvc -e test -r
** Fatal: 0ms+0: missing body for NVC.VERILOG."or"(25NVC.VERILOG.T_LOGIC_ARRAY25NVC.VERILOG.T_LOGIC_ARRAY)25NVC.VERILOG.T_LOGIC_ARRAY
commenting out the clk_gate_n instanciation gives
** Fatal: 0ms+1: missing body for NVC.VERILOG."="(25NVC.VERILOG.T_LOGIC_ARRAY25NVC.VERILOG.T_LOGIC_ARRAY)19NVC.VERILOG.T_LOGIC
The text was updated successfully, but these errors were encountered:
The test case passes now but I don't think it'll help you much as there is currently the a delta cycle delay before the update to the gated clock, as if you'd written it in VHDL. The problem is NVC doesn't currently implement Verilog's scheduling model where a blocking assignment should cause sensitive processes to be scheduled immediately in the current scheduling region.
nickg
changed the title
missing body for NVC.VERILOG."or", NVC.VERILOG."="
Verilog scheduling semantics for blocking assignment
Nov 3, 2024
We are trying to simulate some simple clockgating blocks that are in verilog. The rest of the design is vhdl.
These seem trivial to convert to VHDL, but the clockgating introduces deltacycle delays on the gated clock.
The design has some signals passing from the non-gated to the gated domain clock, which would skip a cycle when we converted the module to vhdl. At least with modelsim the CLK and GCLK would allign on the same deltacycle.
commenting out the
clk_gate_n
instanciation givesThe text was updated successfully, but these errors were encountered: