In-/Output of modules

C

Chris Menz

Guest
Hi there,

I'm a Newbie and have a little problem.

I have some instances of the same module, the outputs from certain
instances are used as inputs for other instances and vice versa. Over
time the connections between instances change.

How can I make a workaround to write the same values from different
module instances to same output (reg) depending on generation?

Code fragment:


....
output [7:0] sortd00, sortd01, sortd02, sortd03,
sortd10, sortd11, sortd12, sortd13,
sortd20, sortd21, sortd22, sortd23,
sortd30, sortd31, sortd32, sortd33;
....

//first instance, writes sortd00,...,sortd13 in odd generations
mergepar merge1
(
sortd00, sortd01, sortd02, sortd03,
sortd10, sortd11, sortd12, sortd13,
...
reset, clock, activeodd
);

//second instance, writes sortd20,...,sortd33 in odd generations
//so no problem here
mergepar merge2
(
sortd20, sortd21, sortd22, sortd23,
sortd30, sortd31, sortd32, sortd33,
...
);

//third instance, writes sortd10,...,sort23 in even generations
//PROBLEM HERE: can't write to sortd10,...,sortd13 because of merge 1
mergepar merge3
(
sortd10, sortd11, sortd12, sortd13,
sortd20, sortd21, sortd22, sortd23,
...
);



Thanks for your help!!!


Chris
 
how about 2:1 mux?

assign sordd10 = is_odd ? sordd10_1 : sordd10_3;

where sordd10_1 is the sordd10 output from merge1 and sordd10_3 is the
sordd10 output from merge3.

HTH,
Jim
jimwu88NOOOSPAM@yahoo.com (remove capital letters)
http://www.geocities.com/jimwu88/chips


"Chris Menz" <cmenz@cse.unsw.edu.au> wrote in message
news:d1l65o$fec$1@tomahawk.unsw.edu.au...
Hi there,

I'm a Newbie and have a little problem.

I have some instances of the same module, the outputs from certain
instances are used as inputs for other instances and vice versa. Over
time the connections between instances change.

How can I make a workaround to write the same values from different
module instances to same output (reg) depending on generation?

Code fragment:


...
output [7:0] sortd00, sortd01, sortd02, sortd03,
sortd10, sortd11, sortd12, sortd13,
sortd20, sortd21, sortd22, sortd23,
sortd30, sortd31, sortd32, sortd33;
...

//first instance, writes sortd00,...,sortd13 in odd generations
mergepar merge1
(
sortd00, sortd01, sortd02, sortd03,
sortd10, sortd11, sortd12, sortd13,
...
reset, clock, activeodd
);

//second instance, writes sortd20,...,sortd33 in odd generations
//so no problem here
mergepar merge2
(
sortd20, sortd21, sortd22, sortd23,
sortd30, sortd31, sortd32, sortd33,
...
);

//third instance, writes sortd10,...,sort23 in even generations
//PROBLEM HERE: can't write to sortd10,...,sortd13 because of merge 1
mergepar merge3
(
sortd10, sortd11, sortd12, sortd13,
sortd20, sortd21, sortd22, sortd23,
...
);



Thanks for your help!!!


Chris
 

Welcome to EDABoard.com

Sponsor

Back
Top