Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

question on Verilog coding

Status
Not open for further replies.

shrikanthke

Newbie level 5
Joined
Jul 25, 2012
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,353
Hi,

I created a memory using command "reg [15:0] memory_bank[3:0];". How to initialise this memory with come values ?
 

Thanks Sharath. i used initial block in that module.

One more question.. I used a inout signal in one module. Now im calling that module from another module. I want to instantiate that module(which uses inout signal). here is my code.


Logic_Controller M2(.logic_controller_enable(logic_controller_enable),.input_to_lc(input_type),.read_enable(read_enable),.write_enable(mem_write),.CLK(CLK),.bus_lc(bus));
Memory M3(.mem_read(mem_read),.mem_write(mem_write),.CLK(CLK),.bus(bus));

here bus_lc and bus are inout signals. When i try to synthesize this, im getting error as "Multiple drivers are connected".
 

here bus_lc and bus are inout signals. When i try to synthesize this, im getting error as "Multiple drivers are connected".
Because you have multiple drivers bus_lc and bus are both driving bus.

An inout port should only be used for pins on a device. Unless there is a library component for building up tristate buses internal to your ASIC, you can't drive multiple outputs onto the same wire. Regardless if such a internal tristate driver library component existed, I would still avoid using such a component.

I only know of one chip vendor that built something like that into their devices (Xilinx) and I'll tell you the device could easily overheat/be_damaged when multiple drivers were driving different values on those tristate buses. I recall being brought onto a project to fix a design that didn't ensure that all drivers were mutually exclusive and did not overlap their enables under any circumstances, the part go so hot you couldn't touch it.
 

Thanks.

So, inout ports can be used inside one module . And it cannot be used in between two devices. is it correct ?
 

You shouldn't use inout unless the port is a pin on a package on the ASIC. And if you use it you better make sure the output is tristateable, otherwise you can never use it as an input.

The synthesis error you were seeing was likely due to the lack of an internal tri-state buffer for the ASIC library you are using.

You can use inout between two devices that are instantiated in a testbench, which is for simulation only. If you don't correctly handle the tri-states you'll end up with Xs on the bus.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top