- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
require help on hierarchic al design
[ Edited ]
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-17-2012 02:34 PM - edited 03-17-2012 03:06 PM
hello
i'm having trouble using nested modules , in always blocks
how should i use a module in always block of a top module?
i want to use module(rf) to calculate some parameters module (alu) to execute then use module (rf) to save them
here's the entire code:
module registerfile(ar1,ar2,re,aw,w,we,clk,r1,r2 );
input re,we,clk;
input [2:0] ar1,ar2,aw;
input [3:0] w;
output reg [3:0] r1,r2;
reg [3:0] rf [0:7];
initial
begin
rf[0] = 4'b0000;
rf[1] = 4'b0000;
rf[2] = 4'b0000;
rf[3] = 4'b0000;
rf[4] = 4'b0000;
rf[5] = 4'b0000;
rf[6] = 4'b0000;
rf[7] = 4'b0000;
r1=4'b0;r2=4'b0;
end
always @(posedge clk)
if (we==1)
begin
rf[aw]=w;
end
always @(negedge clk)
if (re==1)
begin
r1=rf[ar1];r2=rf[ar2];
end
else
begin
r1=4'bx;r2=4'bx;
end
endmodule
module alu(a,b,op,out,c,n,z,v
);
input [3:0] a,b;
input [2:0] op;
output reg [3:0] out;
output reg z,n,v,c;
reg [2:0] x;
reg c3;
always @*
if (op[2:1]==2'b00)
begin
case (op[0])
1'b0: {c,out}=a+b;
1'b1: {c,out}=a-b;
endcase
{c3,x}={{a[2:0]}-{b[2:0]}};v=c^c3;z = out?1'b0:1'b1;n = {out[3]}?{1'b1}:{1'b0};
end
else
begin
case(op)
3'b010: out=a&b;
3'b011: out=a|b;
3'b100: out=a^b;
3'b101: out=~a;
3'b110: out=~(a&b);
3'b111: out=~(a|b);
default: out=4'b000;
endcase
z = out?{1'b0}:{1'b1};n = {out[3]}?{1'b1}:{1'b0};c=1'bx;v=1'bx;
end
endmodule
i can't use lower level modules in an always block placed in the top module
is there any solutions?
regards
Reza balaei
Re: require help on hierarchic al design
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
03-17-2012 03:19 PM
is there a way to call module procedually??
Re: require help on hierarchic al design
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
05-19-2012 02:22 AM
My campus has absitively to enhance aegis by installing high-definition IP cameras throughout its campus network. After evaluating altered products, the Cisco 4300 Video Surveillance camera was called as the standard. We recognizes that the added camera traffic, forth with its management, will crave a above advancement to the arrangement infrastructure. I am asked to architecture a arrangement switching basement basement that absolutely supports both the absolute abstracts cartage and the added camera cartage according to the afterward requirements. Your arrangement architecture should abode anniversary of the afterward requirements:
1. Must accede with the Cisco hierarchical architecture model;
2. Must accommodate physical, as able-bodied as logical, redundancy;
3. Must accommodate 1Gb uplinks;
4. Must articulation camera IP cartage from the absolute arrangement for aegis reasons;
5. Must abutment a minimum of 150 cameras;
6. Must advance PoE for cameras to abstain the use of ability artery or ability injectors;
7. Must accommodate acceptable bandwidth for abounding HD support; and
8. Must abbreviate arbor space. UGH...I am so abashed and dont even apperceive area to begin! Any advice would be appreciated!
[url=http://jigsawpuzzlesonline.us/]jigsaw puzzles[/url]
[url=http://jogosdabarbie9.org/]jogos da barbie[/url]











