Я столкнулся с несколькими проблемами при синтезе некоторого кода Verilog, хотя симуляции, похоже, в порядке.
В частности, модуль определяется следующим образом.
module nexys2_sevensegment(
input clk,
input [NUM_CHARS*4-1: 0] disp_chars,
output [NUM_CHARS-1: 0] anodes, // The common cathodes for each display.
output [6: 0] cathodes // The seven segments in the form {G,F,E,D,C,B,A}
);
parameter NUM_CHARS = 4; // The number of characters that need to be
// displayed. Should be in [1, 4].
И создан следующим образом:
nexys2_sevensegment #(4) seven_seg_disp(clk, disp_bus, an, seg);
Моделирование работает нормально, но когда я синтезирую его, я получаю следующую ошибку:
=========================================================================
* HDL Compilation *
=========================================================================
Compiling verilog file "nexys2_sevensegment.v" in library work
ERROR:HDLCompilers:28 - "nexys2_sevensegment.v" line 8 'NUM_CHARS' has not been declared
ERROR:HDLCompilers:28 - "nexys2_sevensegment.v" line 9 'NUM_CHARS' has not been declared
Compiling verilog file "tb_nexys2_seven_segment.v" in library work
Module <nexys2_sevensegment> compiled
Module <tb_nexys2_seven_segment> compiled
Analysis of file <"tb_nexys2_seven_segment.prj"> failed.
Я работаю над Xilinx с Spartan3e-1200 - Digilent Nexys2.
Спасибо !