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.

Instantiation of modules in Verilog

Status
Not open for further replies.

QMA

Member level 4
Joined
Apr 5, 2007
Messages
72
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,832
Dear all
how can I instantiate a module for example 'abc' in verilog. it has inputs for example 'a' and 'b' with output 'c'. let I instantiate this abc module in 'jkl' with inputs 'j' and 'k'. the input 'j' is equal to output 'c'. How can I do this?
1. shall i declare 'j' as input?
2. if not necessary then i think 'j' will be a reg. Am I right?
what will be programming statement
 

You should read the following and then try out yourself:
**broken link removed**

2. if not necessary then i think 'j' will be a reg. Am I right?
what will be programming statement
Why don't you just try out and see. There can't be any physical harm to anything even if you do it wrong!
 

thank you dear. i have gone through the article. now i have come across another issue. let suppose

i have a ram 'abc'(a--input, b--address, c--output). i have made its instance s0. i want to retrieve value of some particular address. how can i do this. is the expression at the end will work.
module abc(a,b,c)
---
endmodule

abc s0 (.a(a), .b(b), .c(c)) //module instantiation

assign value = s0 //retrieving some value from the address b of instance s0.
 

Verilog isn't a software language, so don't use it like its software. Think of instances as if the are ICs on a PCB. A RAM chip on a board requires you drive an address on the address pins (verilog port), drive the write strobe active and supply data to be written to the address on the address pins.

What you don't do is try to use the instance name (equivalent to a U number on a PCB) as a call to the module.

You should read a Verilog book before trying to code. Depending on your background you may even need to read a digital design book first. Just keep in mind that Verilog code describes hardware, it is not a procedural programming language.
 
  • Like
Reactions: QMA

    QMA

    Points: 2
    Helpful Answer Positive Rating
in the above expression 's0' is instance name. i have pre written the data in RAM. now i want to fetch it. i am facing errors while fetching it.
 

in the above expression 's0' is instance name. i have pre written the data in RAM. now i want to fetch it. i am facing errors while fetching it.

Just show the Error up here mate. I am sure it is easier to deal with.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top