Der Fehler kann beim direkten Instanziieren einer First-in-First-out-Bibliothek (FIFO) parameterisierter Module (LPM) auftreten. Wenn der instanziierte FIFO-Puffer die Zelle verwendet und zwei arithmetische Funktionen protokolliert, können die Parameter nicht über das defparam
Argument übertragen werden. Das unten stehende Beispiel funktioniert nicht, selbst wenn es korrekt codiert ist.
. . . module fifo256x8 (data, rreq, wreq, clock, clockx2, aclr, threshlevel, threshold, empty, full, usedw, q); input [7:0] data; input [7:0] threshlevel; input rreq, wreq, clock, clockx2, aclr; output [7:0] q; output [7:0] usedw; output threshold, empty, full; sfifo inst_1 (.data (data), .rreq (rreq), .wreq (wreq), .clock (clock), .clockx2 (clockx2), .aclr (aclr), .q (q), .usedw (usedw), .threshold (threshold), .empty (empty), .threshlevel (threshlevel), .full (full)); defparam inst_1.lpm_width = 8; defparam inst_1.lpm_numwords = 256; endmodule . . .
Die Problemumgehung besteht darin, die FIFO-Funktion in einer Dummy Graphic Design File (.gdf)-Datei mit all ihrem Parametersatz zu instanziieren und ihr einen spezifischen Namen (z. B. my_fifo.gdf) zu geben. Erstellen Sie eine Standard-Include-Datei (.inc) für die GDF. Instanziieren Sie die GDF im Verilog HDL-Code der obersten Ebene ohne angegebenen Parameter. Das unten stehende Beispiel funktioniert (entsprechend dem oben genannten Beispiel).
. . . module fifo256x8 (data, rreq, wreq, clock, clockx2, aclr, threshlevel, threshold, empty, full, usedw, q); input [7:0] data; input [7:0] threshlevel; input rreq, wreq, clock, clockx2, aclr; output [7:0] q; output [7:0] usedw; output threshold, empty, full; my_fifo inst_1 (.data (data), .rreq (rreq), .wreq (wreq), .clock (clock), .clockx2 (clockx2), .aclr (aclr), .q (q), .usedw (usedw), .threshold (threshold), .empty (empty), .threshlevel (threshlevel), .full (full)); endmodule . . .
my_fifo.gdf enthält eine Instanziierung von SFIFO
mit lpm_width = 8
und lpm_numwords = 256
. Die oben beschriebene Port-Zuordnung bezieht sich auf my_fifo.gdf und nicht auf die SFIFO
Megafunktion.