Telegram Group & Telegram Channel
Продолжаю тыкать палкой интерфейсы совместно с опенсорсными тулами. На этот раз речь пойдет про массивы интерфейсов, в частности их применимость в портах модулей.

Следующий код компилируется в Verilator, Tabby CAD (Yosys+Verific) и в Vivado. Yosys с открытым плагином от Antmicro ругается на массив интерфейсов в описании портов модуля (Encountered unhandled type in process_port: interface_array).

interface iface;
logic a;
modport in(input a);
endinterface

module test_mod (iface.in x[2], output logic y);
assign y = x[0].a | x[1].a;
endmodule

module top (input logic [1:0] x, output logic y);
iface i[2]();
test_mod DUT (i, y);

assign i[0].a = x[0];
assign i[1].a = x[1];
endmodule

Одиночный интерфейс, не в виде массива, открытым плагином поддерживается и успешно синтезируется.

Порадовала утилита sv2v, которая преобразовала этот код в код на чистом верилоге, который успешно синтезировался Yosys без плагинов.

module top (x, y);
input wire [1:0] x;
output wire y;
genvar _arr_DA352;
generate
for (_arr_DA352 = 0; _arr_DA352 <= 1; _arr_DA352 = _arr_DA352 + 1) begin : i
wire a;
end
endgenerate
localparam _bbase_D0DCC_x = 0;
generate
if (1) begin : DUT
localparam _mbase_x = 0;
wire y;
assign y = top.i[0].a | top.i[1].a;
end
endgenerate
assign y = DUT.y;
assign i[0].a = x[0];
assign i[1].a = x[1];
endmodule

Можно заметить, что утилита сохранила иерархию интерфейсов. Т.е., например, констрейны не сломаются, т.к. пути к сигналам сохранятся. Можно безболезненно симулировать код в Icarus, не опасаясь поломки иерархии.



group-telegram.com/enginegger/4
Create:
Last Update:

Продолжаю тыкать палкой интерфейсы совместно с опенсорсными тулами. На этот раз речь пойдет про массивы интерфейсов, в частности их применимость в портах модулей.

Следующий код компилируется в Verilator, Tabby CAD (Yosys+Verific) и в Vivado. Yosys с открытым плагином от Antmicro ругается на массив интерфейсов в описании портов модуля (Encountered unhandled type in process_port: interface_array).

interface iface;
logic a;
modport in(input a);
endinterface

module test_mod (iface.in x[2], output logic y);
assign y = x[0].a | x[1].a;
endmodule

module top (input logic [1:0] x, output logic y);
iface i[2]();
test_mod DUT (i, y);

assign i[0].a = x[0];
assign i[1].a = x[1];
endmodule

Одиночный интерфейс, не в виде массива, открытым плагином поддерживается и успешно синтезируется.

Порадовала утилита sv2v, которая преобразовала этот код в код на чистом верилоге, который успешно синтезировался Yosys без плагинов.

module top (x, y);
input wire [1:0] x;
output wire y;
genvar _arr_DA352;
generate
for (_arr_DA352 = 0; _arr_DA352 <= 1; _arr_DA352 = _arr_DA352 + 1) begin : i
wire a;
end
endgenerate
localparam _bbase_D0DCC_x = 0;
generate
if (1) begin : DUT
localparam _mbase_x = 0;
wire y;
assign y = top.i[0].a | top.i[1].a;
end
endgenerate
assign y = DUT.y;
assign i[0].a = x[0];
assign i[1].a = x[1];
endmodule

Можно заметить, что утилита сохранила иерархию интерфейсов. Т.е., например, констрейны не сломаются, т.к. пути к сигналам сохранятся. Можно безболезненно симулировать код в Icarus, не опасаясь поломки иерархии.

BY Arnold Enginegger




Share with your friend now:
group-telegram.com/enginegger/4

View MORE
Open in Telegram


Telegram | DID YOU KNOW?

Date: |

Andrey, a Russian entrepreneur living in Brazil who, fearing retaliation, asked that NPR not use his last name, said Telegram has become one of the few places Russians can access independent news about the war. Individual messages can be fully encrypted. But the user has to turn on that function. It's not automatic, as it is on Signal and WhatsApp. It is unclear who runs the account, although Russia's official Ministry of Foreign Affairs Twitter account promoted the Telegram channel on Saturday and claimed it was operated by "a group of experts & journalists." "The result is on this photo: fiery 'greetings' to the invaders," the Security Service of Ukraine wrote alongside a photo showing several military vehicles among plumes of black smoke. The news also helped traders look past another report showing decades-high inflation and shake off some of the volatility from recent sessions. The Bureau of Labor Statistics' February Consumer Price Index (CPI) this week showed another surge in prices even before Russia escalated its attacks in Ukraine. The headline CPI — soaring 7.9% over last year — underscored the sticky inflationary pressures reverberating across the U.S. economy, with everything from groceries to rents and airline fares getting more expensive for everyday consumers.
from us


Telegram Arnold Enginegger
FROM American