คุณอาจได้รับข้อผิดพลาดเมื่อสร้างอินสแตนซ์ในไลบรารีก่อนออกก่อน (FIFO) ของฟังก์ชันโมดูลพารามิเตอร์ (LPM) โดยตรง หากบัฟเฟอร์ FIFO ที่มีการสร้างอินสแตนซ์ใช้เซลล์และบันทึกฟังก์ชันทางคณิตสองฟังก์ชัน จะไม่สามารถส่งค่าพารามิเตอร์ผ่านการ defparam
ป้อนค่าได้ ตัวอย่างด้านล่างไม่ทํางานแม้ว่าจะมีการเข้ารหัสอย่างถูกต้อง
. . . 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 . . .
การแก้ปัญหาคือการสร้างอินสแตนซ์ของฟังก์ชัน FIFO ในไฟล์ Dummy Graphic Design File (.gdf) ที่มีชุดพารามิเตอร์ทั้งหมดและตั้งชื่อเฉพาะ (เช่น my_fifo.gdf) สร้างไฟล์ Include (.inc) เริ่มต้นสําหรับ GDF สร้างอินสแตนซ์ GDF ในโค้ด Verilog HDL ระดับบนสุดโดยไม่ต้องระบุพารามิเตอร์ใดๆ ตัวอย่างด้านล่างจะทํางาน (ที่เกี่ยวข้องกับตัวอย่างข้างต้น)
. . . 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 ประกอบด้วยการสร้างอินสแตนซ์พร้อม SFIFO
lpm_width = 8
และ lpm_numwords = 256
การแมปพอร์ตด้านบนหมายถึง my_fifo.gdf และไม่ใช่ SFIFO
การทํางานที่ยุ่งเหวี่ยง