FPGA Central - World's 1st FPGA / CPLD Portal

FPGA Central

World's 1st FPGA Portal

 

Go Back   FPGA Groups > NewsGroup > FPGA

FPGA comp.arch.fpga newsgroup (usenet)

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-23-2007, 07:48 PM
fl
Guest
 
Posts: n/a
Default How to simulate these example CORDIC code?

Hi,
I want to learn the implementation of CORDIC. I find the following
website has some code which I would like begin with it.


http://www.ht-lab.com/freecores/cordic/cordic.html

But I cannot simply simulate it in my Modelsim PE (student version)
because of the setup problem. Could you, the FPGA and VHDL experts can
tell me how to simulate it? Especially could you tell me how its
structure about the behaviour and synthesis files arranged?


Thanks in advance.
Reply With Quote
  #2 (permalink)  
Old 11-23-2007, 09:05 PM
KJ
Guest
 
Posts: n/a
Default Re: How to simulate these example CORDIC code?


"fl" <[email protected]> wrote in message
news:[email protected]m...
> Hi,
> I want to learn the implementation of CORDIC. I find the following
> website has some code which I would like begin with it.
>
>
> http://www.ht-lab.com/freecores/cordic/cordic.html
>
> But I cannot simply simulate it in my Modelsim PE (student version)
> because of the setup problem.

What is the 'setup problem'? I'd suggest solving that first.

>Could you, the FPGA and VHDL experts can
> tell me how to simulate it?

I'd use Modelsim

> Especially could you tell me how its
> structure about the behaviour and synthesis files arranged?
>

Modelsim's GUI interface has a function that figures out the correct
ordering of the files in the project. Right click on one of the source
files and then under 'Compile' look for something that says about
auto-generating the compile order (I forget what the exact verbage is, but
it's there).

KJ


Reply With Quote
  #3 (permalink)  
Old 11-23-2007, 09:12 PM
fl
Guest
 
Posts: n/a
Default Re: How to simulate these example CORDIC code?

On Nov 23, 4:05 pm, "KJ" <[email protected]> wrote:
> "fl" <[email protected]> wrote in message
>
> news:[email protected]m...> Hi,
> > I want to learn the implementation of CORDIC. I find the following
> > website has some code which I would like begin with it.

>
> >http://www.ht-lab.com/freecores/cordic/cordic.html

>
> > But I cannot simply simulate it in my Modelsim PE (student version)
> > because of the setup problem.

>
> What is the 'setup problem'? I'd suggest solving that first.
>
> >Could you, the FPGA and VHDL experts can
> > tell me how to simulate it?

>
> I'd use Modelsim
>
> > Especially could you tell me how its
> > structure about the behaviour and synthesis files arranged?

>
> Modelsim's GUI interface has a function that figures out the correct
> ordering of the files in the project. Right click on one of the source
> files and then under 'Compile' look for something that says about
> auto-generating the compile order (I forget what the exact verbage is, but
> it's there).
>
> KJ


Thank you for your reply. The following is from the add_files.tcl in
the work_ps directory. I guess these files to form work library.


add_input_file -format {VHDL} -work Cordic {D:/DEMO/demo_hdl_designer/
Cordic/hdl/shiftn_synthesis.vhd}
add_input_file -format {VHDL} -work Cordic {D:/DEMO/demo_hdl_designer/
Cordic/hdl/addsub_synthesis.vhd}
add_input_file -format {VHDL} -work Cordic {D:/DEMO/demo_hdl_designer/
Cordic/hdl/atan32_Arch1.vhd}
add_input_file -format {VHDL} -work Cordic {D:/DEMO/demo_hdl_designer/
Cordic/hdl/fsm_synthesis.vhd}
add_input_file -format {VHDL} -work Cordic {D:/DEMO/demo_hdl_designer/
Cordic/hdl/cordic_pkg_pkg.vhd}
add_input_file -format {VHDL} -work Cordic {D:/DEMO/demo_hdl_designer/
Cordic/hdl/cordic_synthesis.vhd}

Then, I form cordic_pkg to Cordic library. But the compiling error is

** Error: (vcom-11) Could not find cordic.addsub.
** Error: C:/Modeltech_pe_edu_6.3c/cordic_learn/hdl/
cordic_synthesis.vhd(143): (vcom-1195) Cannot find expanded name
"cordic.addsub".

That is the compiler looks for addsub in the Cordic lib, not work lib.
What's wrong? What is the function and differences of the directory
files. I cannot what are for simulation, what are for synthesis.
Thanks again.
Reply With Quote
  #4 (permalink)  
Old 11-23-2007, 09:19 PM
fl
Guest
 
Posts: n/a
Default Re: How to simulate these example CORDIC code?

On Nov 23, 4:05 pm, "KJ" <[email protected]> wrote:
> "fl" <[email protected]> wrote in message
>
> news:[email protected]m...> Hi,
> > I want to learn the implementation of CORDIC. I find the following
> > website has some code which I would like begin with it.

>
> >http://www.ht-lab.com/freecores/cordic/cordic.html

>
> > But I cannot simply simulate it in my Modelsim PE (student version)
> > because of the setup problem.

>
> What is the 'setup problem'? I'd suggest solving that first.
>
> >Could you, the FPGA and VHDL experts can
> > tell me how to simulate it?

>
> I'd use Modelsim
>
> > Especially could you tell me how its
> > structure about the behaviour and synthesis files arranged?

>
> Modelsim's GUI interface has a function that figures out the correct
> ordering of the files in the project. Right click on one of the source
> files and then under 'Compile' look for something that says about
> auto-generating the compile order (I forget what the exact verbage is, but
> it's there).
>
> KJ



BTW, part of the contents in the cordic_synthesis.vhl is as the below.
Is it useful to understand the configuration?

-- Optional embedded configurations
-- pragma synthesis_off
FOR ADD1 : addsub USE ENTITY cordic.addsub;
FOR ADD2 : addsub USE ENTITY cordic.addsub;
FOR ADD3 : addsub USE ENTITY cordic.addsub;
FOR ALL : atan32 USE ENTITY cordic.atan32;
FOR ALL : fsm USE ENTITY cordic.fsm;
FOR ALL : shiftn USE ENTITY cordic.shiftn;
-- pragma synthesis_on

Thank you very much.
Reply With Quote
  #5 (permalink)  
Old 11-23-2007, 09:37 PM
fl
Guest
 
Posts: n/a
Default Re: How to simulate these example CORDIC code?

On Nov 23, 4:05 pm, "KJ" <[email protected]> wrote:
> "fl" <[email protected]> wrote in message
>
> news:[email protected]m...> Hi,
> > I want to learn the implementation of CORDIC. I find the following
> > website has some code which I would like begin with it.

>
> >http://www.ht-lab.com/freecores/cordic/cordic.html

>
> > But I cannot simply simulate it in my Modelsim PE (student version)
> > because of the setup problem.

>
> What is the 'setup problem'? I'd suggest solving that first.
>
> >Could you, the FPGA and VHDL experts can
> > tell me how to simulate it?

>
> I'd use Modelsim
>
> > Especially could you tell me how its
> > structure about the behaviour and synthesis files arranged?

>
> Modelsim's GUI interface has a function that figures out the correct
> ordering of the files in the project. Right click on one of the source
> files and then under 'Compile' look for something that says about
> auto-generating the compile order (I forget what the exact verbage is, but
> it's there).
>
> KJ


Another question, how to run the "compile.scr "?
Reply With Quote
  #6 (permalink)  
Old 11-23-2007, 09:55 PM
Mike Treseler
Guest
 
Posts: n/a
Default Re: How to simulate these example CORDIC code?

fl wrote:

> Another question, how to run the "compile.scr "?


I expect that you have to find modelsim.ini
and fix up the source paths to match
where they are on your machine.

Note that learning cordic theory has nothing
to do with learning vhdl or modelsim.
I would suggest starting with simpler examples
or tutorials for each topic.

And I would recommend not spending
any time learning hdl designer.
Just use an editor and modelsim directly.

-- Mike Treseler
Reply With Quote
  #7 (permalink)  
Old 11-24-2007, 10:04 AM
HT-Lab
Guest
 
Posts: n/a
Default Re: How to simulate these example CORDIC code?


"fl" <[email protected]> wrote in message
news:[email protected]m...
> Hi,
> I want to learn the implementation of CORDIC. I find the following
> website has some code which I would like begin with it.
>
>
> http://www.ht-lab.com/freecores/cordic/cordic.html
>
> But I cannot simply simulate it in my Modelsim PE (student version)
> because of the setup problem. Could you, the FPGA and VHDL experts can
> tell me how to simulate it? Especially could you tell me how its
> structure about the behaviour and synthesis files arranged?
>
>
> Thanks in advance.


Send me an email and I will create a standalone Modelsim version for you. I
wrote this code some time ago using HDL Designer and Modelsim.

Regards,
Hans
www.ht-lab.com


Reply With Quote
  #8 (permalink)  
Old 11-24-2007, 10:24 AM
HT-Lab
Guest
 
Posts: n/a
Default Re: How to simulate these example CORDIC code?


"HT-Lab" <[email protected]> wrote in message
news:[email protected]
>
> "fl" <[email protected]> wrote in message
> news:[email protected]m...

... snip

>>
>> Thanks in advance.

>
> Send me an email and I will create a standalone Modelsim version for you.


Use this procedure:

1) Navigate to the work_mti directory in a DOSbox/cygwin/Msys shell etc
2) Issue the following command

vlib Cordic
vmap work Cordic
vcom -work Cordic -just p ..\hdl\*.vhd
vcom -work Cordic -just b ..\hdl\*.vhd
vcom -work Cordic -just e ..\hdl\*.vhd
vcom -work Cordic -just a ..\hdl\*.vhd
vsim -c -do tb.scr

And you should get something like:

# Angle=60101B Sin=3FD815 Expected=3FD816 Cos=0476E0 Expected=0476E3 PASS
# Angle=612E10 Sin=3FE98D Expected=3FE98B Cos=035976 Expected=035978 PASS
# Angle=624C04 Sin=3FF603 Expected=3FF604 Cos=023BCB Expected=023BCB PASS
# Angle=6369F8 Sin=3FFD7E Expected=3FFD81 Cos=011DF3 Expected=011DF0 PASS
# ** Failure: *** End of Test ***

Next remove all the std_logic_arith/std_logic_unsigned package references
and replace them with the recommended numeric_std package :-)

Regards,
Hans.
www.ht-lab.com


Reply With Quote
  #9 (permalink)  
Old 11-26-2007, 03:15 AM
fl
Guest
 
Posts: n/a
Default Re: How to simulate these example CORDIC code?

On 24 nov, 05:24, "HT-Lab" <[email protected]> wrote:
> "HT-Lab" <[email protected]> wrote in message
>
> news:[email protected]
>
> > "fl" <[email protected]> wrote in message
> >news:[email protected]m...

>
> .. snip
>
>
>
> >> Thanks in advance.

>
> > Send me an email and I will create a standalone Modelsim version for you.

>
> Use this procedure:
>
> 1) Navigate to the work_mti directory in a DOSbox/cygwin/Msys shell etc
> 2) Issue the following command
>
> vlib Cordic
> vmap work Cordic
> vcom -work Cordic -just p ..\hdl\*.vhd
> vcom -work Cordic -just b ..\hdl\*.vhd
> vcom -work Cordic -just e ..\hdl\*.vhd
> vcom -work Cordic -just a ..\hdl\*.vhd
> vsim -c -do tb.scr
>
> And you should get something like:
>
> # Angle=60101B Sin=3FD815 Expected=3FD816 Cos=0476E0 Expected=0476E3 PASS
> # Angle=612E10 Sin=3FE98D Expected=3FE98B Cos=035976 Expected=035978 PASS
> # Angle=624C04 Sin=3FF603 Expected=3FF604 Cos=023BCB Expected=023BCB PASS
> # Angle=6369F8 Sin=3FFD7E Expected=3FFD81 Cos=011DF3 Expected=011DF0 PASS
> # ** Failure: *** End of Test ***
>
> Next remove all the std_logic_arith/std_logic_unsigned package references
> and replace them with the recommended numeric_std package :-)
>
> Regards,
> Hans.www.ht-lab.com


Thank you for your reply. I don't know the reason of:

> Next remove all the std_logic_arith/std_logic_unsigned package references
> and replace them with the recommended numeric_std package :-)
>


Could you tell me that?

Thanks again.
Reply With Quote
  #10 (permalink)  
Old 12-06-2007, 02:10 PM
Guest
 
Posts: n/a
Default Re: How to simulate these example CORDIC code?

On Nov 24, 1:04 pm, "HT-Lab" <[email protected]> wrote:
> "fl" <[email protected]> wrote in message
>
> news:ccb086d1-775c-44cf-8666-bc357a309[email protected]
>
> > Hi,
> > I want to learn the implementation ofCORDIC. I find the following
> > website has some code which I would like begin with it.

>
> >http://www.ht-lab.com/freecores/cordic/cordic.html

>
> > But I cannot simply simulate it in my Modelsim PE (student version)
> > because of the setup problem. Could you, the FPGA and VHDL experts can
> > tell me how to simulate it? Especially could you tell me how its
> > structure about the behaviour and synthesis files arranged?

>
> > Thanks in advance.

>
> Send me an email and I will create a standalone Modelsim version for you. I
> wrote this code some time ago using HDL Designer and Modelsim.
>
> Regards,
> Hanswww.ht-lab.com


We do appreciate, if it be possible to use a standalone Modelsim
version of project.
Would U plz upload it or give some clue.
Sincerely.
MrM
Reply With Quote
  #11 (permalink)  
Old 12-06-2007, 08:12 PM
KJ
Guest
 
Posts: n/a
Default Re: How to simulate these example CORDIC code?

On Dec 6, 9:10 am, [email protected] wrote:
> On Nov 24, 1:04 pm, "HT-Lab" <[email protected]> wrote:
>
>
>
>
>
> > "fl" <[email protected]> wrote in message

>
> >news:[email protected]m...

>
> > > Hi,
> > > I want to learn the implementation ofCORDIC. I find the following
> > > website has some code which I would like begin with it.

>
> > >http://www.ht-lab.com/freecores/cordic/cordic.html

>
> > > But I cannot simply simulate it in my Modelsim PE (student version)
> > > because of the setup problem. Could you, the FPGA and VHDL experts can
> > > tell me how to simulate it? Especially could you tell me how its
> > > structure about the behaviour and synthesis files arranged?

>
> > > Thanks in advance.

>
> > Send me an email and I will create a standalone Modelsim version for you. I
> > wrote this code some time ago using HDL Designer and Modelsim.

>
> > Regards,
> > Hanswww.ht-lab.com

>
> We do appreciate, if it be possible to use a standalone Modelsim
> version of project.
> Would U plz upload it or give some clue.
> Sincerely.
> MrM- Hide quoted text -
>
> - Show quoted text -


Try Altera or Xilinx, etc. for the web or student version where they
bundle in a limited version of Modelsim.

KJ
Reply With Quote
  #12 (permalink)  
Old 12-10-2007, 09:17 AM
Guest
 
Posts: n/a
Default Re: How to simulate these example CORDIC code?

On Dec 6, 11:12 pm, KJ <[email protected]> wrote:
> On Dec 6, 9:10 am, [email protected] wrote:
>
>
>
> > On Nov 24, 1:04 pm, "HT-Lab" <[email protected]> wrote:

>
> > > "fl" <[email protected]> wrote in message

>
> > >news:[email protected]m...

>
> > > > Hi,
> > > > I want to learn the implementation ofCORDIC. I find the following
> > > > website has some code which I would like begin with it.

>
> > > >http://www.ht-lab.com/freecores/cordic/cordic.html

>
> > > > But I cannot simply simulate it in my Modelsim PE (student version)
> > > > because of the setup problem. Could you, the FPGA and VHDL experts can
> > > > tell me how to simulate it? Especially could you tell me how its
> > > > structure about the behaviour and synthesis files arranged?

>
> > > > Thanks in advance.

>
> > > Send me an email and I will create a standalone Modelsim version for you. I
> > > wrote this code some time ago using HDL Designer and Modelsim.

>
> > > Regards,
> > > Hanswww.ht-lab.com

>
> > We do appreciate, if it be possible to use a standalone Modelsim
> > version of project.
> > Would U plz upload it or give some clue.
> > Sincerely.
> > MrM- Hide quoted text -

>
> > - Show quoted text -

>
> Try Altera or Xilinx, etc. for the web or student version where they
> bundle in a limited version of Modelsim.
>
> KJ


I do not have any of following folders!
simprim = D:/vendors/Xilinx/mti/simprim
x55 = D:/hdl_designs/x55/work_mti
XilinxCoreLib = D:/vendors/Xilinx/mti/xilinxcorelib
altera_mf = D:/vendors/quartus/mti/altera_mf
mercury = D:/vendors/quartus/mti/mercury
Shared_lib = D:/DEMO/demo_hdl_designer/Shared_lib/work_mti
??
Reply With Quote
  #13 (permalink)  
Old 12-10-2007, 05:53 PM
Mike Treseler
Guest
 
Posts: n/a
Default Re: How to simulate these example CORDIC code?

[email protected] wrote:

> I do not have any of following folders!
> simprim = D:/vendors/Xilinx/mti/simprim
> x55 = D:/hdl_designs/x55/work_mti
> XilinxCoreLib = D:/vendors/Xilinx/mti/xilinxcorelib
> altera_mf = D:/vendors/quartus/mti/altera_mf
> mercury = D:/vendors/quartus/mti/mercury
> Shared_lib = D:/DEMO/demo_hdl_designer/Shared_lib/work_mti
> ??

!!

If you write your own code, you won't need them.
See the testbench example here:
http://home.comcast.net/~mike_treseler/


Reply With Quote
  #14 (permalink)  
Old 12-10-2007, 07:17 PM
HT-Lab
Guest
 
Posts: n/a
Default Re: How to simulate these example CORDIC code?


<[email protected]> wrote in message
news:[email protected]m...
> On Dec 6, 11:12 pm, KJ <[email protected]> wrote:
>> On Dec 6, 9:10 am, [email protected] wrote:
>> > - Show quoted text -

... snip
>
> I do not have any of following folders!
> simprim = D:/vendors/Xilinx/mti/simprim
> x55 = D:/hdl_designs/x55/work_mti
> XilinxCoreLib = D:/vendors/Xilinx/mti/xilinxcorelib
> altera_mf = D:/vendors/quartus/mti/altera_mf
> mercury = D:/vendors/quartus/mti/mercury
> Shared_lib = D:/DEMO/demo_hdl_designer/Shared_lib/work_mti
> ??


These are just Modelsim library mappings for my setup. I would suggest you
delete the modelsim.ini file and create a new one using the vmap command.
Then if required update the file with your primitive library mapping like
simprim/lpm etc, this is easily done using the GUI (Right_Mouse_Button in
the workspace tab -> new -> library),

Hans
www.ht-lab.com


Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with Verilog : Cordic Code Posted. dash82 Verilog 1 11-25-2007 04:33 AM
can anyone help me to simulate & debug this verilog code i wrote? indra Verilog 3 04-17-2007 10:53 AM
CORDIC FM Demodulation ma FPGA 8 11-27-2006 05:32 PM
What is 1QN and 2QN in Xilinx CORDIC ? ML FPGA 1 02-18-2006 01:59 AM
Cordic v2.0 : cordic translate algorithm problem Tobias FPGA 0 12-22-2005 12:07 PM


All times are GMT +1. The time now is 12:12 PM.


Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright 2008 @ FPGA Central. All rights reserved