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.

nco in modelsim and quartusII

Status
Not open for further replies.

rameshbalan

Member level 2
Member level 2
Joined
Jan 11, 2012
Messages
44
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Visit site
Activity points
1,563
i create one code for nco in modelsim. this works correctly. but while simulating in Quartus it is not works i dont know why.
code is,
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
use ieee.math_real.all;

entity ncocode is
GENERIC (amp_res : INTEGER := 8; -- output amplitude resolution
phas_res : INTEGER := 12; -- phase resolution
acc_size:INTEGER:=32 --accumulater size
);
port(fcw : in std_logic_vector(phas_res-1 downto 0);
clk: in std_logic;
opval : out std_logic_vector(amp_res-1 downto 0));
end ncocode;
architecture behav of ncocode is
constant romsize:integer:=2**phas_res-1;
constant romwidth:integer:=2**(amp_res-1)-1;
constant wavesize:integer:=2**(phas_res-1);
constant beta : integer := integer(((2**amp_res)-1)/2);
signal temp : std_logic_vector(phas_res-1 downto 0):="000000000000";
signal romvar : std_logic_vector(amp_res-1 downto 0);

begin
process(clk)
VARIABLE x: REAL;
begin
if rising_edge(clk) then
temp<= temp + fcw;
x:= (SIN(real(conv_integer(temp))*MATH_PI/real(wavesize)));
romvar<=STD_LOGIC_VECTOR(CONV_SIGNED(INTEGER(x*real(beta))-(1/2),amp_res));
end if;
end process;
opval <= romvar;
end behav;

--------------------------------------------------------------------------
please tell immediately.
 

The question will be precisely answered by a Quartus error message:
Error (10414): VHDL Unsupported Feature error at ncocode.vhd(26): cannot synthesize non-constant real objects or values
You'll need to implement the sine table as a ROM. It can be calculated in VHDL at compile time.
 
thank you sir. i need why it cant calculate like that. i tried using ROM table. it give correct answer. what difference does it make. please explain .
 

QSIM is a gate level simulator, it can only simulate synthesizable logic. Real data type and sine() function aren't synthesizable.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top