J
jgg
Guest
Hi everyone,
I'm trying to understand how to properly use clocking blocks and
interfaces in both synthesis code (where the clocking block is
ignored) and test bench code where it is used, and I'm not really sure
what the expected standard behavior should be..
For instance, if I have an interface like this:
interface foo(input logic Clk);
logic A;
logic B;
clocking cki @(posedge Clk);
input A;
output B;
endclocking;
clocking cko @(posedge Clk);
output A;
input B;
endclocking;
modport STB(clocking cki, clocking cko);
modport IN(input A, output B);
modport OUT(output A, input B);
end interface;
This is very similar to examples in the Chris Spear book..
I wan to use this in three ways:
1) To drive from a TB into a module with a foo.IN mod port
2) To monitor from a TB from a module with a foUT mod port
3) To interconnect two modules between foo.IN and foUT
But at least with Questa the clocking block gets in the way - it
considers the clocking block to be driving the signal even if there is
no reference to the clocking block. Ie the inout A in the clocking
block prevents a modport OUT connection because the module is driving
A.
Is this correct? Should a clocking block output be considered a driver
of a variable if there are no references to the clocking block? If so
then how can you effectively use clocking blocks?
Thanks,
Jason
I'm trying to understand how to properly use clocking blocks and
interfaces in both synthesis code (where the clocking block is
ignored) and test bench code where it is used, and I'm not really sure
what the expected standard behavior should be..
For instance, if I have an interface like this:
interface foo(input logic Clk);
logic A;
logic B;
clocking cki @(posedge Clk);
input A;
output B;
endclocking;
clocking cko @(posedge Clk);
output A;
input B;
endclocking;
modport STB(clocking cki, clocking cko);
modport IN(input A, output B);
modport OUT(output A, input B);
end interface;
This is very similar to examples in the Chris Spear book..
I wan to use this in three ways:
1) To drive from a TB into a module with a foo.IN mod port
2) To monitor from a TB from a module with a foUT mod port
3) To interconnect two modules between foo.IN and foUT
But at least with Questa the clocking block gets in the way - it
considers the clocking block to be driving the signal even if there is
no reference to the clocking block. Ie the inout A in the clocking
block prevents a modport OUT connection because the module is driving
A.
Is this correct? Should a clocking block output be considered a driver
of a variable if there are no references to the clocking block? If so
then how can you effectively use clocking blocks?
Thanks,
Jason