Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Unknown type Xilinx error

Status
Not open for further replies.

madalin1990

Full Member level 2
Joined
Apr 4, 2012
Messages
124
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Activity points
2,090
Hi! I have defined a register with serial input and a paralel output. Problem is that when i'm compiling i receive the following errors. Any idea why?

ERROR:HDLCompiler:806 - "C:\Users\agrancea\Desktop\licenta\iir\sp.v" Line 23: Syntax error near "<=".
ERROR:HDLCompiler:44 - "C:\Users\agrancea\Desktop\licenta\iir\sp.v" Line 21: int_cnt is not a constant
ERROR:HDLCompiler:1059 - "C:\Users\agrancea\Desktop\licenta\iir\sp.v" Line 23: data_out is an unknown type
ERROR:HDLCompiler:1059 - "C:\Users\agrancea\Desktop\licenta\iir\sp.v" Line 24: int_cnt is an unknown type

Here's the code:
Code:
module sp(rst, clk, data_in, data_out);
  
	input rst, clk, data_in;
	output reg[7:0] data_out;

	reg [13:0] int_reg;
	reg [3:0] int_cnt;
	
	always @(negedge clk or negedge rst)
			if(rst==0)
				begin
				data_out <= 8'b0;
				int_cnt <= 4'b0;
				end
			else
				begin
				int_cnt <= int_cnt+1;
				int_reg[int_cnt] <= data_in;
				end
			if(int_cnt == 4'b1101) // se reseteaza numaratorul la 13
				begin
				data_out <= int_reg[7:0];
				int_cnt <= 4'b0;		
				end
	
endmodul
 

you have:
Code:
  always @(/.../)
    if
    
    else
    
    if

should be [depends on your intention]

Code:
  always @(/.../)
   begin
     if
    
     else
    
     if
   end
   
// --- or

  always @(/.../)
    if
    
    else if
    
    else


j.
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top