help

T

thomas

Hi

I am have a problem with this code

process (notAccessStart, notWrite)
begin -- process
if notAccessStart'event and notAccessStart = '1' then
if notWrite = '0' then
case AddressByte is
when "00000" => reg0(rx_index) <= DataByte;
rx_index <= rx_index + 1;
if rx_index = 5 then
rx_index <= 0;
end if;
when "00001" => reg1(rx_index) <= DataByte;
rx_index <= rx_index + 1;
if rx_index = 5 then
rx_index <= 0;
end if;
 
P

Pieter Hulshoff

thomas said:
process (notAccessStart, notWrite)
begin -- process
if notAccessStart'event and notAccessStart = '1' then

2 things:
1. Since you're using notAccessStart as a clock, the notWrite in the
sensitive list doesn't do anything.
2. I'm surprised to see you react to a rising edge of a signal called
notAccessStart.
if notWrite = '0' then
case AddressByte is
when "00000" => reg0(rx_index) <= DataByte;
rx_index <= rx_index + 1;
if rx_index = 5 then
rx_index <= 0;
end if;
if AddressByte is "00000" I what to start writing to reg0(0) then
reg0(1) then reg0(2) ...
but the first write always starts at rx_index=1 ( reg0(1) )

This process will just continue with the rx_index as it was the last time it
was used (+1 considering the adder in almost every branch). As such you
cannot tell what value it will start with when you enter the "00000"
branch. You'll need to take a hard look at your initialization and
execution to figure out how it will work. Since I have no idea of how the
driving signals notAccessStart, notWrite, and AddressByte are generated, I
cannot really comment on this.

Regards,

Pieter Hulshoff
 
T

thomas

Pieter said:
2 things:
1. Since you're using notAccessStart as a clock, the notWrite in the
sensitive list doesn't do anything.
2. I'm surprised to see you react to a rising edge of a signal called
notAccessStart.






This process will just continue with the rx_index as it was the last time it
was used (+1 considering the adder in almost every branch). As such you
cannot tell what value it will start with when you enter the "00000"
branch. You'll need to take a hard look at your initialization and
execution to figure out how it will work. Since I have no idea of how the
driving signals notAccessStart, notWrite, and AddressByte are generated, I
cannot really comment on this.

Regards,

Pieter Hulshoff

thanks I will do that

regards

thomas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top