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

Verilog Compiliation Error

Altera_Forum
Honored Contributor II
1,736 Views

Hi, 

 

I am trying to implement a scaling function for the FFT Megacore Function. I copied and modified the Verlilog code from http://www.altera.com/literature/an/an404.pdf. My modified code is attached. However, Quartus doesn't compile, claiming a syntax error, which I have also attached. 

 

Someone pls tell me where i have gone wrong. I am totally new to Verilog and have no idea what is wrong. Thanks.
0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
864 Views

A case statement can only exist inside an always block. 

 

always @* begin case(exp_0) ... ... endcase end
0 Kudos
Altera_Forum
Honored Contributor II
864 Views

oh ok, i didn't know that. thanks jakobjones!! i'll go try it out now. 

0 Kudos
Altera_Forum
Honored Contributor II
864 Views

I have modified the code and added in a couple of lines but now, the error is that the "Top partition does not contain any logic". Attached is the new code. Anyone can help me on this? Thanks.

0 Kudos
Altera_Forum
Honored Contributor II
864 Views

 

--- Quote Start ---  

I have modified the code and added in a couple of lines but now, the error is that the "Top partition does not contain any logic". Attached is the new code. Anyone can help me on this? Thanks. 

--- Quote End ---  

 

 

 

Hi, 

 

I tried your source code in Quartus project (Quartus 9.0 SP2) and it finished sucessfully. 

What was your toplevel when you run your project. BTW your are not using the clk, so get a lot of latches in your design. Is the code generated by the Megawizard ? 

 

Kind regards 

 

GPK
0 Kudos
Altera_Forum
Honored Contributor II
864 Views

Hi, 

 

I am also using Quartus 9.0 SP2 but it still comes up as "Can't synthesize current design -- Top partition does not contain any logic". 

 

How do I find out my toplevel? Sorry, i'm pretty new to this stuff. No, not all the code was generated by Megawizard, only the inputs and outputs. The rest are from a website provided by Altera (http://www.altera.com/literature/an/an404.pdf) (http://www.altera.com/literature/an/an404.pdf

 

Thanks for your response.
0 Kudos
Altera_Forum
Honored Contributor II
864 Views

 

--- Quote Start ---  

Hi, 

 

I am also using Quartus 9.0 SP2 but it still comes up as "Can't synthesize current design -- Top partition does not contain any logic". 

 

How do I find out my toplevel? Sorry, i'm pretty new to this stuff. No, not all the code was generated by Megawizard, only the inputs and outputs. The rest are from a website provided by Altera (http://www.altera.com/literature/an/an404.pdf) (http://www.altera.com/literature/an/an404.pdf

 

Thanks for your response. 

--- Quote End ---  

 

 

Hi. 

 

why do you generate only the ports with the Megawizard? I think the code in the application note is only an example to show how it works.  

 

Can you post your Quartus project as a tar-file in the forum ? 

 

Kind regards 

 

GPK
0 Kudos
Altera_Forum
Honored Contributor II
864 Views

Apologies, I didn't use Megawizard at all. I just used a block tool and created a design file from the block. There's nothing else on the board except that function. As you adviced, I have included the function to work on the positive clock edge. 

 

yeah, i know the code given is only an example, but that's exactly what i'm trying to do. just a simple scaling function. Didn't think i'd run into this much problems...:(
0 Kudos
Altera_Forum
Honored Contributor II
864 Views

 

--- Quote Start ---  

Apologies, I didn't use Megawizard at all. I just used a block tool and created a design file from the block. There's nothing else on the board except that function. As you adviced, I have included the function to work on the positive clock edge. 

 

yeah, i know the code given is only an example, but that's exactly what i'm trying to do. just a simple scaling function. Didn't think i'd run into this much problems...:( 

--- Quote End ---  

 

 

 

Hi , 

 

can you post the file "test_scaling", where you use the scaling block as an instance ? 

 

Kind regards 

 

GPK
0 Kudos
Reply