UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor trnkttc
Visitor
211 Views
Registered: ‎08-08-2019

Rising and Falling edge error

hi

I do not simulate

I want to lick both the rising and failing edge of the 1 entry How can I do this I'd try

if Signal_in'event and Signal_in='1' then

i <= i + 1;

elsif Signal_in2'event and Signal_in2='0' then

i <= i + 1;

end if;

if Signal_in'event then if Signal_in = '1' and edge_state=false then i <= i + 1;

edge_state <= true; elsif Signal_in = '0' and edge_state=true then i <= i + 1;

edge_state <= false;

end if;

end if;

not works

0 Kudos
3 Replies
188 Views
Registered: ‎06-21-2017

Re: Rising and Falling edge error

First, "not works" is a poor description of your problem.  Do you get an error message?  Is it a syntax check error, a synthesis error or an Implementation error?  What is the error message and what line in your code does it reference?

The only registers in a Xilinx FPGA that can respond to both the rising edge and falling edge of a clock are in the Input/Output tiles.  Registers inside the FPGA can only respond to one edge of a clock. 

Your code has multiple registers driving the signal "i".  Only one register output may drive a signal.

Are Signal_in and Signal_in2 really clocks (constantly running periodic signals) or are they something else?  Using a regular signal as the clock input to a register is very bad design practice.

Scholar drjohnsmith
Scholar
183 Views
Registered: ‎07-09-2009

Re: Rising and Falling edge error

A few other comments

 

welcome to the world of VHDL.

You will love and hate the strict constraints, stick with it its worth it.

String suggestions

a) Dont use Signal_in'event and Signal_in='1'  , use if rising_edge( signal_in )

b) make certin this is inside a process with the correct sensetiity list

c) Always simulate...  Simulatoin is quicker than synthesis and tells you a lot more about your circuit . You will spend may be 60 % of your life simulating, 30 % designing, and 10 percent waiting for synthesis.

d) always rember that your code is describing hardware, if you can't think what the hardware is , the its likely the tools can not either.

( and yes there are no DDR flip flops in the FPGA )

Why do yo u want  DDR internal flipflops ?

 

 

<== If this was helpful, please feel free to give Kudos, and close if it answers your question ==>
Scholar dpaul24
Scholar
157 Views
Registered: ‎08-07-2014

Re: Rising and Falling edge error

@trnkttc,

if Signal_in'event and Signal_in='1' then

i <= i + 1;

elsif Signal_in2'event and Signal_in2='0' then

i <= i + 1;

end if;

Not possible to do within the FPGA.

Pay attention to what others have said above.

 

--------------------------------------------------------------------------------------------------------
FPGA enthusiast!
All PMs will be ignored
--------------------------------------------------------------------------------------------------------