Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20713 Discussions

modelsim: how to use parameter and error faced

Altera_Forum
Honored Contributor II
2,051 Views

It is pretty fine when i use QII to compile my design. However, when i use modelsim-starter edition, a lots of error popping out. 

 

Error: 

Identifier must be declared with a port mode: d. 

 

My submodule: 

module fir_comb_RAM1(clk, reset, ena, valid, d, count, q, RAM_coeff, mult_result); 

 

input clk; 

input reset; 

input ena; 

input valid; 

input [count_w-1:0] count; 

input signed [signal_mag_w-1:fp_w] d; 

input signed [signal_mag_w-1:fp_w] q ; 

input signed [coeff_w-1:fp_w] RAM_coeff; 

 

I have no idea why modelsim ask me to declare d as a port since i already declare it as input 

 

Besides, how to use parameter in modelsim? In Qii, i use it as below: 

e.g1: 

input [count_w-1:0] count; 

 

parameter count_w = 4; 

 

It gives me an error undefined variable of count_w; 

 

e.g2: 

if (count_64 < (max_coeff+1))... 

 

It gives me an error undefined variable of max_coeff; 

 

Any idea? 

 

thanks
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
1,251 Views

The 2 errors caused by 1 problem only. The placement of parameter should be put on top after the entity. what a silly mistake.. 

 

thanks
0 Kudos
Reply