In reply to ben@SystemVerilog.us:
It has been a very very long time since I did any real designs and synthesis, thus I am not fully aware of newer technologies in this field. A search on documentation revealed this link:
https://docs.xilinx.com/search/all?query=synthesis&content-lang=en-US
Targeting SystemVerilog for a Specific File
By default, the Vivado synthesis tool compiles *.v files with the Verilog 2005 syntax and *.sv files with the SystemVerilog syntax.
…
Interfaces provide a way to specify communication between blocks. An interface is a group of nets and variables that are grouped together to make connections.
[Ben] This is followed by an example where 2 modules use an interface as a connection
only; basically, it looks to me that an interface, for synthesis, is just a bunch of wires used for connection only. Any code inside the interface is ignored (?? need to verify this) The example:
interface my_int
logic sel;
logic [9:0] data1, data2, result;
endinterface : my_int
// In the two bottom-level modules, you can change to:
module bottom1 (
my_int int1, // <------------- the interface for the bundle
input clk,
input [9:0] d1, d2,
input s1,
output logic equal);
endmodule
module bottom2 (
my_int int1,
input clk);
// Ben code
always #(posedge clk)
if (int1.sel) int1.result <= int1.data1;
endmodule
module top(
input clk,
input s1,
input [9:0] d1, d2,
output equal);
my_int int3(); //instantiation, <------------- the interface for the bundle
bottom1 u0 (int3, clk, d1, d2, s1, equal);
bottom2 u1 (int3, clk);
endmodule
Modeports are also supported
interface my_int;
logic sel;
logic [9:0] data1, data2, result;
modport b1 (input result, output sel, data1, data2);
modport b2 (input sel, data1, data2, output result);
endinterface : my_int
// In the bottom modules, use when declared:
module bottom1 (
my_int.b1 int1,
also supported
Class
Instances Supported
Member and method access Supported
Constructors Supported
Static class member and methods Supported
Access using 'this' and 'super' Supported
Object assignment Supported
Inheritance Supported
Data hiding and encapsulation Supported
Scope and resolution operator (::) Supported
Nested classes Supported
Objects inside structs Supported
Tasks
// Be careful when using these tasks; Vivado synthesis treats all tasks as automatic.
Coverage control functions Not Supported
Static and Automatic task Supported
Tasks memory usage and concurrent activation Not Supported
Functions
Return values and void functions Supported
Static and Automatic function Supported
Constant function Supported
I have been dated as I am still stuck on Verilog syntax for synthesis.
My emphasis is on assertions though.
Thanks for bringing the issue.
Ben