Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > VHDL > Standardized internal module bus

Reply
Thread Tools

Standardized internal module bus

 
 
Richo
Guest
Posts: n/a
 
      12-28-2006
Hi All,

I'm trying to have a standardized internal bus for reading & writing
module registers. The external bus is more or less a standard SRAM type
bus (CLK, NCE, RDNWR, ADDRESS, DATA + NRESET), and I can implement the
read/write for a simple register ok. However, what I'm trying to do is
have a single data bus shared by all modules and have each module
implement their own registers (the code is below). This works fine
until I have more than one module on the bus - as soon as I do this, I
get an error (Xilinx ISE) of "Multi-source in Unit <Framework> on
signal <DATA_BUS_IN<15>>". I realize that both modules are connecting
to the same bus, but due to the chip selects, only one module is ever
driving data onto the bus at any given time. Obviously, I can just have
a huge bus (16 bits for every module) and run them through a
multiplexor, but this seems to be a very innefficient use of resources.
Any ideas how I can use a single bus to implement the register
interface for all modules? I've cut and paste the code below.

Thanks,

Glenn.

------------------------------------

Inside module:

process (CLK) is
begin
if CLK'event and CLK = '1' then
if (NRESET = '0') then
-- Initialize the registers
resetRegisters(kRegMax, registers, reg_init);
else
-- Do the register read/write
doReadWrite(kRegMax, registers, NCS, RDNWR, DATA_BUS_IN,
DATA_BUS_OUT, ADDRESS);
end if;
end if;
end process;


------------------------------------

Procedure definitions:

-- Procedure to reset registers
procedure resetRegisters(maxreg : in positive;
signal registers : out data_register(maxreg
downto 0);
reg_init : in data_register(maxreg
downto 0)
) is
begin
-- Loop through the registers and assign the initialization value
for i in 0 to maxreg loop
-- Assign register
registers(i) <= reg_init(i);
end loop;
end resetRegisters;

procedure doReadWrite(maxreg : in positive;
signal registers : inout
data_register(maxreg downto 0);
NCS, RDNWR : in std_logic;
signal DATA_BUS_IN : in std_logic_vector(15
downto 0);
signal DATA_BUS_OUT : out std_logic_vector(15
downto 0);
signal address : in STD_LOGIC_VECTOR (3
downto 0)
) is

begin
if (NCS = '0') then
-- Determine the address offset
if (RDNWR = '1') then
-- Read cycle, output the data
DATA_BUS_OUT <= registers(CONV_INTEGER(address));
else
-- Write cycle, write the data to the register
registers(CONV_INTEGER(address)) <= DATA_BUS_IN;
end if;
--else
-- Don't output data onto the bus
DATA_BUS_OUT <= "ZZZZZZZZZZZZZZZZ";
end if;
end doReadWrite;

 
Reply With Quote
 
 
 
 
Marcus Harnisch
Guest
Posts: n/a
 
      12-28-2006
"Richo" <(E-Mail Removed)> writes:

> Obviously, I can just have
> a huge bus (16 bits for every module) and run them through a
> multiplexor, but this seems to be a very innefficient use of resources.
> Any ideas how I can use a single bus to implement the register


This is how it's normally done. Check if your device supports internal
tri-state signals.

Regards,
-- Marcus
 
Reply With Quote
 
 
 
 
Richo
Guest
Posts: n/a
 
      12-28-2006
Hi Marcus,

Thanks for the suggestion - it wasn't actually the problem, but it
turns out I was driving onto the bus in two different modules. Anyway,
the code I pasted above works fine, thanks

Glenn.

On Dec 28, 9:26 pm, Marcus Harnisch <(E-Mail Removed)> wrote:
> "Richo" <(E-Mail Removed)> writes:
> > Obviously, I can just have
> > a huge bus (16 bits for every module) and run them through a
> > multiplexor, but this seems to be a very innefficient use of resources.
> > Any ideas how I can use a single bus to implement the registerThis is how it's normally done. Check if your device supports internal

> tri-state signals.
>
> Regards,
> -- Marcus


 
Reply With Quote
 
 
 
Reply

Thread Tools

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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: standardized us address Chris Mellon Python 1 02-12-2007 06:33 PM
Standardized formats for classification metadata? Grant Robertson XML 6 01-09-2007 04:07 AM
standardized interfaces Mike Treseler VHDL 0 11-06-2006 04:19 PM
Address Bus and External Data Bus Confusion LoXodonte A+ Certification 1 04-18-2006 09:09 PM
Is 'if' standardized? DeMarcus Java 4 06-16-2005 04:48 PM



Advertisments