Sign In

Don't have a Xilinx account yet?

  • Choose to receive important news and product information
  • Gain access to special content
  • Personalize your web experience on Xilinx.com

Create Account

Username

Password

Forgot your password?
XClose Panel
Xilinx Home
Reply
Visitor
mjeschke
Posts: 18
Registered: ‎04-04-2012
0
Accepted Solution

Clock Edge Errors... ??

I'm a little rusty with VHDL and FPGA development.  It's been around 8 years since I've worked with them last.

 

However, I'm diving back in.  It's simple enough to describe what I want to create in VHDL.  However, it's plauging me with Clock Edge errors.

 

For instance my sensatively list has 3 signals in it.

 

I have a if else statement checking rising edges on two of those signals.

 

It simulated perfectly.  Then I went back and ONLY changed the width of one of the registers I had in my code.  I changed it's width from 4 bytes to 3.  This register is not in the process's sensatively list either.

 

Now my code will not even synthesize.  It throws a unfortunately familar error...

 

Line 40: statement is not synthesizable since it does not hold its value under NOT(clock-edge) condition

 

I revered the code back to what WAS synthesizing and simulating perfectly, with the 4 byte wide register.  This was the only change I had to revert.

 

It STILL throws the same error despite this code was working perfectly before.  I have no idea what's going on with it.  I even went so far as to cleanup project files and restart the IDE.

 

I've been having lot's of difficulty with these clock edges.  Can somebody explain to me what I'm doing to agrivate the synthesizer?  Or why the software is so irradic.  Is it just the opperator or something I'm doing wrong?  I'm at a loss...

 

Thanks!!!!



Expert Contributor
gszakacs
Posts: 5,258
Registered: ‎08-14-2007
0

Re: Clock Edge Errors... ??

It simulated perfectly.

 

But did it ever synthesize?

 

My sensitively list has 3 signals in it.   I have a if else statement checking rising edges on two of those signals.

 

What sort of register can clock on two different input signals?

 

Line 40: statement is not synthesizable since it does not hold its value under NOT(clock-edge) condition

 

Can you post the code for the process that includes line 40?

 

-- Gabor

-- Gabor
Expert Contributor
bassman59
Posts: 4,671
Registered: ‎02-25-2008
0

Re: Clock Edge Errors... ??

You might wish to post your code.


----------------------------------------------------------------
Yes, I do this for a living.
Visitor
mjeschke
Posts: 18
Registered: ‎04-04-2012
0

Re: Clock Edge Errors... ??

I got rid of the rising_edge checks for Reset and Execute.  I now just check their level...

 

Here's the code

 

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;


entity crcCalc is

Port (
clock : in STD_LOGIC; -- system clock (for shifting)
reset : in STD_LOGIC; -- reset signal (active high)
execute : in STD_LOGIC; -- Start calculation (active high)
data : in STD_LOGIC_VECTOR(31 downto 0); -- data for CRC
remainder: out STD_LOGIC_VECTOR(7 downto 0); -- result of CRC
idle : out STD_LOGIC -- Signals component state (idle = 1 available)
);

end crcCalc;


architecture Behavioral of crcCalc is

type crcStates is (IDLE_STATE, BUSY_STATE);
signal nextState : crcStates := IDLE_STATE;

-- Latch execute command so input doesn't have to be held high
signal executeCrc : boolean := false;

-- Registers to shift data during CRC calculation
signal crcShiftReg: std_logic_vector(7 downto 0) := (others=>'0');
signal dataIn : std_logic_vector(31 downto 0) := (others=>'0');

begin

process( clock, reset, execute )

variable crcCount : integer range 0 to 32 := 0;

begin

RST : if( reset = '1' )then

dataIn <= (others=>'0');
crcShiftReg <= (others=>'0');
nextState <= IDLE_STATE;
executeCrc <= false;

elsif( execute = '1' )then

executeCrc <= true;

else

case nextState is

-----------------------------------------------------------------------------
-- Pushes Idle output high, CRC calculation is available in Idle state
when IDLE_STATE =>

idle <= '1';
crcCount := 0;

if( executeCrc )then
dataIn <= data;
nextState <= BUSY_STATE;
end if;

-----------------------------------------------------------------------------
-- Locks out CRC component while performing calculation (unless reset).
when BUSY_STATE =>

idle <= '0';

if( crcCount < 32 )then

crcCount := crcCount + 1;

dataIn <= dataIn(30 downto 0) & '0';
crcShiftReg(0) <= dataIn(31) xor crcShiftReg(7);
crcShiftReg(1) <= crcShiftReg(0) xor crcShiftReg(7);
crcShiftReg(2) <= crcShiftReg(1) xor crcShiftReg(7);
crcShiftReg(3) <= crcShiftReg(2) xor crcShiftReg(7);
crcShiftReg(4) <= crcShiftReg(3);
crcShiftReg(5) <= crcShiftReg(4) xor crcShiftReg(7);
crcShiftReg(6) <= crcShiftReg(5);
crcShiftReg(7) <= crcShiftReg(6);

else

-- Calculation complete. Push out result and return to idle state
remainder <= crcShiftReg;
nextState <= IDLE_STATE;
executeCrc <= false;

end if;

end case;

end if RST;

end process;

end Behavioral;

Expert Contributor
eteam00
Posts: 7,505
Registered: ‎07-21-2009
0

Re: Clock Edge Errors... ??

I got rid of the rising_edge checks for Reset and Execute.  I now just check their level...

 

Are the problems now fixed?

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
Expert Contributor
gszakacs
Posts: 5,258
Registered: ‎08-14-2007

Re: Clock Edge Errors... ??


eteam00 wrote:

I got rid of the rising_edge checks for Reset and Execute.  I now just check their level...

 

Are the problems now fixed?

 

-- Bob Elkind


Not unless you think a shift register without a clock is "fixed."

 

The process as written now has no edge dependencies.  I think the OP likely

meant to write

 

  elsif rising_edge (clock) then

 

instead of

 

  else

 

at the end of the reset process.

 

-- Gabor

-- Gabor
Visitor
mjeschke
Posts: 18
Registered: ‎04-04-2012
0

Re: Clock Edge Errors... ??

I had given my shift register some thought already...

 

I think for what I'm doing it should work.  I don't really care if the calculation / shift is performed on an edge just so long as it doesn't over run the crc shift register.  It simulates fine... but unfortunately, I don't have target hardware yet to test on so I'm keeping my fingers crossed.

 

Thanks so much for the tips everybody.  I have a ltitle better understanding of my folly's now :)

 

 

Expert Contributor
eteam00
Posts: 7,505
Registered: ‎07-21-2009
0

Re: Clock Edge Errors... ??

I had given my shift register some thought already...  I think for what I'm doing it should work.

 

How does a flip-flop, or a shift register, function without a clock?

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.
Visitor
mjeschke
Posts: 18
Registered: ‎04-04-2012
0

Re: Clock Edge Errors... ??

the clock is on the sensativity list so from what I understand...

 

If the clock's state changes, from low to high or high to low (rising_edge or falling_edge) the process will run.

 

I just didn't specify which edge I was interested in.  So when I simulate it performs the shift on both the rising edge and the falling edge.

 

Otherwise if execute or reset change state (other items on sensatively list) then the clock shift isn't performed untl the next clock edge because of the else if structure.

 

Maybe I'm backwards in my thinking.  I know it's sloppy to code that way but it makes since to me and seems to simulate fine.  Have to see what the hardware does when I get it though...

Expert Contributor
eteam00
Posts: 7,505
Registered: ‎07-21-2009
0

Re: Clock Edge Errors... ??

So when I simulate it performs the shift on both the rising edge and the falling edge.

 

In other words, you are simulating a fiction with no possibility of translation to real FPGA hardware.

 

I know it's sloppy to code that way but it makes since to me and seems to simulate fine.

 

This may be OK if the work you are doing is for an academic paper or thesis.  It is not OK for a design on which your company depends for its livelihood, or if you are preparing yourself for a career as an FPGA designer.

 

Have to see what the hardware does when I get it though...

 

You will have a long wait.  Your code is not synthesisable, to an FPGA target device.  This assertion is easily and quickly tested, yes?

 

-- Bob Elkind

SIGNATURE:
README for newbies is here: http://forums.xilinx.com/t5/New-Users-Forum/README-first-Help-for-new-users/td-p/219369

Summary:
1. Read the manual or user guide. Have you read the manual? Can you find the manual?
2. Search the forums (and search the web) for similar topics.
3. Do not post the same question on multiple forums.
4. Do not post a new topic or question on someone else's thread, start a new thread!
5. Students: Copying code is not the same as learning to design.
6 "It does not work" is not a question which can be answered. Provide useful details (with webpage, datasheet links, please).
7. You are not charged extra fees for comments in your code.
8. I am not paid for forum posts. If I write a good post, then I have been good for nothing.