Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - modeling connecting Processor with memory

 
Thread Tools Search this Thread
Old 06-18-2005, 02:40 PM   #1
Default modeling connecting Processor with memory


dear

I implemented simple processor (actually simple FSM) -
- Input port: clock, reset, data_in
- Output prot: enable(memory enable), rw(read/write), address, data_out

And consider Memory (Xilinx BRAM) -
- Input port: EN, CLK, DI, RESET, WE, ADDR
- Output port: DO

Then I directly connected the processor with Memory, as follows.
- processor to Memory : enable => EN, rw => we, address => ADDR,
data_out => DI,
- memory to processor : DO => data_in
- clock and reset are all the same

Processor is working fine when the FSM (processor) is written as the
following.

Problem is that it is not working when the 'execution process below' is
rising edge clocked.

If someone has experience on this, let me know....

Thankyou in advance

---------------------------
architecture
begin
process(reset,clock) -- state transition process
begin
if reset='1' then
CS<=Init; -- current state
elsif clock'event and clock='1' then -- rising edge
NS<=CS; -- next state
end if;
end process;

process(CS,...)
begin
case ES is
when Init =>
if a='0' then NS <= READ_MEM1;
end if;
when READ_MEM1 =>
if b='1' then NS <= READ_MEM2;
end if;
.....
end case;
end process;

process (clock) -- execution process
begin
if clock'event and clock='0' then -- falling edge (ok)
-- if clock'event and clock='1' then -- rising edge (NOT ok)
case CS is
.....................
end case;
end if;
end process;
------------------------------------------------



Pasacco
  Reply With Quote
Old 06-18-2005, 07:01 PM   #2
Mike Treseler
 
Posts: n/a
Default Re: modeling connecting Processor with memory
Pasacco wrote:

> Problem is that it is not working when the 'execution process below' is
> rising edge clocked.


Consider running a simulation and looking
at the waveforms. Sounds like clock
and data are changing on the same tick.
Maybe you need a wait state.

-- Mike Treseler


Mike Treseler
  Reply With Quote
Old 06-19-2005, 01:36 PM   #3
Pasacco
 
Posts: n/a
Default Re: modeling connecting Processor with memory
Hi

That is correct that clock and data transit at the same time. Thankyou
for comment.

BTW, how is the coding style of the 3rd process in FSM above. 3rd
process is for combinational execution (generating output) block.

Is it okay to use falling edge clock in the process ?
Compared to non-clock or rising edge clock, what is advantage or
disadvantage ? Maybe falling edge clock in 3rd process is not a good
coding

Thankyou for anyone who comments



Pasacco
  Reply With Quote
Old 06-19-2005, 04:18 PM   #4
Mike Treseler
 
Posts: n/a
Default Re: modeling connecting Processor with memory
Pasacco wrote:

> That is correct that clock and data transit at the same time. Thankyou
> for comment.


You are welcome.

> BTW, how is the coding style of the 3rd process in FSM above. 3rd
> process is for combinational execution (generating output) block.


Consider combining everything into one clocked process.

> Is it okay to use falling edge clock in the process ?


Your life will be simpler with one clock.
For FPGAs flops come free with the gates.
Might as well use them.

> Compared to non-clock or rising edge clock, what is advantage or
> disadvantage ? Maybe falling edge clock in 3rd process is not a good
> coding


The advantage of using one clocked process is
that all outputs are automatically registered.
There is no internal wiring to worry about.
It just works, and you don't have to think so much.

-- Mike Treseler


Mike Treseler
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
OCZ 6GB Triple-Channel 1333 MHz DDR3 Memory Kit Admin Front Page News 0 02-16-2009 01:27 PM
memory upgrade -D- A+ Certification 1 02-03-2007 01:01 AM
Re: What memory to use? me A+ Certification 0 12-14-2004 03:33 AM
Re: Memory stick question Nildram A+ Certification 1 01-14-2004 02:41 PM
Half memory: lost? Joe A+ Certification 4 09-04-2003 08:57 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46