help

T

thomas

Guest
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;
.
.
.
when "10110" => rx_index <= 0;
when others => null;
end process;

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) )

does anyone know what the problem is ??

regards
thomas
 
thomas wrote:
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;
snip
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
 
Pieter Hulshoff wrote:
thomas wrote:

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;

snip

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
thanks I will do that

regards

thomas
 
i am new in VHDL coding, could any body can tell me, whats difference
between C and VHDL. how implementation differs and how to decide, what
part of code should be run on chip and what on system.
 
On 25 Jun, 07:28, rahul.bajai...@gmail.com wrote:
i am new in VHDL coding, could any body can tell me, whats difference
between C and VHDL. how implementation differs and how to decide, what
part of code should be run on chip and what on system.
C is a programming language that described a series of procedural
instructions to be run one after the other on a CPU.
VHDL is a Hardware description language (ie. Very high speed
integrated circuit Hardware Description Language) and is therefor NOT
a programming language. You could not use it to create a program to
run on any CPU. It describes concurrent digital logic.

They are two very different things. In theory, for example, you could
use VHDL to describe a CPU, then use C to run a program on the
processor you have described in VHDL.
 
On Jun 25, 12:47 pm, Tricky <Trickyh...@gmail.com> wrote:
On 25 Jun, 07:28, rahul.bajai...@gmail.com wrote:

i am new in VHDL coding, could any body can tell me, whats difference
between C and VHDL. how implementation differs and how to decide, what
part of code should be run on chip and what on system.

C is a programming language that described a series of procedural
instructions to be run one after the other on a CPU.
VHDL is a Hardware description language (ie. Very high speed
integrated circuit Hardware Description Language) and is therefor NOT
a programming language. You could not use it to create a program to
run on any CPU. It describes concurrent digital logic.

They are two very different things. In theory, for example, you could
use VHDL to describe a CPU, then use C to run a program on the
processor you have described in VHDL.
thanks tricky can i get to know some links for this thing...

since i am working on a project in VHDL. really confused, which part
of the code to be kept on system and which on the chip. please help me
out.

thanks in advance
 
On Jun 25, 5:41 am, rahul.bajai...@gmail.com wrote:
On Jun 25, 12:47 pm, Tricky <Trickyh...@gmail.com> wrote:



On 25 Jun, 07:28, rahul.bajai...@gmail.com wrote:

i am new in VHDL coding, could any body can tell me, whats difference
between C and VHDL. how implementation differs and how to decide, what
part of code should be run on chip and what on system.

C is a programming language that described a series of procedural
instructions to be run one after the other on a CPU.
VHDL is a Hardware description language (ie. Very high speed
integrated circuit Hardware Description Language) and is therefor NOT
a programming language. You could not use it to create a program to
run on any CPU. It describes concurrent digital logic.

They are two very different things. In theory, for example, you could
use VHDL to describe a CPU, then use C to run a program on the
processor you have described in VHDL.

thanks tricky can i get to know some links for this thing...

since i am working on a project in VHDL. really confused, which part
of the code to be kept on system and which on the chip. please help me
out.

thanks in advance
it depends on what kind of project you are now doing..
It is possible to but all the things in to HDL...but the size of your
system will be very large. It will slow down the speed.
Or you can put a simple CPU+interface(in VHDL code) and write all your
program in C

Something is Hard ware then you use VHDL, something is software put
into C...
But I believe you cannot classify the different between two...

STEPS FOR YOU
1.try to find some digital design book, and read the TOC, see what
kind of hardware in digital design mean :)
All the thing on the TOC are possible to build by vhdl code in the
FPGA. (MUX, ADDER, SHIFTER....)

2.if you system is hardware + software, then you need to have a CPU.
Find the resources from altera, they have a lot information talking
about what is CPU.

3.Then ..all the requirement..if they are not Hardware, then they are
software.
 

Welcome to EDABoard.com

Sponsor

Back
Top