Home > other >  Verilog grammar question
Verilog grammar question

Time:09-17

Would you please tell me what the grammar errors below a piece of code? Always ERROR ERROR - c:/work/program/lattice/rm_cpld/source/efb_i2c v (66) : syntax ERROR near,. VERI - 1137, locate the input CLK, the line,
The module efb_i2c # (parameter STATE_BUFFER_NUM=4,//GPI port number
GPI data width parameter STATE_BUFFER_WIDTH=8,//
The parameter CONTROL_BUFFER_NUM=4,//GPO port number
The parameter CONTROL_BUFFER_WIDTH=8,//GPO data width
The parameter BUFFER_MAX_NUM=8//GPI port number
)
(
Inout SCL,
Inout SDA,
Input RST_N,
The input CLK,
The output [STATE_BUFFER_WIDTH - 1-0] STATE_BUFFER [STATE_BUFFER_NUM - 1-0],
Input [CONTROL_BUFFER_WIDTH - 1-0] CONTROL_BUFFER [CONTROL_BUFFER_NUM - 1-0],
Inout CMD_BUFFER
);

CodePudding user response:

Such change
The output STATE_BUFFER_WIDTH - 1-0 STATE_BUFFER,
Input CONTROL_BUFFER_WIDTH - 1-0 CONTROL_BUFFER,
Inout CMD_BUFFER

CodePudding user response:

The output [STATE_BUFFER_WIDTH - 1-0] STATE_BUFFER [STATE_BUFFER_NUM - 1-0],
A two-dimensional array without compression cannot directly input/output

This change also go
The output [STATE_BUFFER_NUM - 1-0] [STATE_BUFFER_WIDTH - 1-0] STATE_BUFFER,

CodePudding user response:

It was Daniel, thank you
  • Related