- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Behavioral Simulation works but Post-Trans late doesn't
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-20-2012 02:14 PM
I've written some code and been messing with it for quite a while now. I can get it to simulate fine with the Behavioral model but when I use the Post Translate model it won't simulate. I'm a bit of a novice but not sure where to look or exactly what this is telling me.
Any suggestions?
Thanks!
------- Here's the code I wrote. It won't drive the output when I simulate the Post-Translation model.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
entity clkDiv is
-- Configure desired clock
generic(
baseClock : integer := 50000000; -- Frequency of input clock
outFreq : integer := 2500000 -- Desired output clock frequency
);
port (
reset : in STD_LOGIC; -- Resets clock / resyncs
clk_in : in STD_LOGIC; -- Base clock input
clk_out : out STD_LOGIC -- Generated clock output
);
end clkDiv;
architecture Behavioral of clkDiv is
-- Number of base clock pulses per output clock pulse
constant ticksPerOutClk : integer := 10;--baseClock / outFreq;
signal clkGen : std_logic := '0';
begin
clk_out <= clkGen;
process( reset, clk_in ) is
variable cycle_counter : integer range 0 to ticksPerOutClk-1 := 0;
begin
if( reset = '1' ) then
cycle_counter := 0;
elsif( rising_edge(clk_in) )then
cycle_counter := cycle_counter+2;
if( cycle_counter >= ticksPerOutClk ) then
cycle_counter := 0;
clkGen <= not clkGen;
end if;
end if;
end process;
end architecture Behavioral;
Re: Behavioral Simulation works but Post-Trans late doesn't
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-22-2012 01:17 AM
If you have:
constant ticksPerOutClk : integer := 10;
then:
variable cycle_counter : integer range 0 to ticksPerOutClk-1 := 0;
has a range from 0 to 9. So :
if( cycle_counter >= ticksPerOutClk ) then
this condition is never met.
Re: Behavioral Simulation works but Post-Trans late doesn't
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
04-23-2012 03:22 AM
I agree wth wuher,
did your design work in behavioral simulation?
Could you give us some indications about why post-translate doesn' work?
Pedro.











