Professional Documents
Culture Documents
Point
Help
Upload
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
Views1
Downloads2
Points 2
Rate0.0
/************************************************************************
MAVENSILICONCONFIDENTIALThisisanunpublished,proprietarywork
ofMavenSiliconSoftechPvt.Ltd.,Bangalore,andisfullyprotected
undercopyrightandtradesecretlaws.Youmaynotview,use,disclose,
copy,ordistributethisfileoranyinformationcontainedhereinexcept
pursuanttoavalidwrittenlicensefromMavenSiliconSoftechPvt.Ltd.,
Bangalore
DesignName:router_1x3
ModuleName:ff_sync
Date:04/10/2009
Description:Thismoduleprovidessynchronizationbetween
fsmandfifofordatacommunication
Author:PRSIVAKUMAR
Email:siva@vlsitraining.com
Company:MavenSilicon,Bangalorewww.vlsitraining.com
Version:1.0revision0.0
*************************************************************************/
moduleff_sync(clock,
resetn,
detect_add,
data,
empty_0,
empty_1,
empty_2,
full_0,
full_1,
full_2,
write_enb_reg,
write_enb,
fifo_empty,
fifo_full,
vld_out_0,
vld_out_1,
vld_out_2
);
//PortDirection
inputclock;
inputresetn;
inputdetect_add;
input[1:0]data;
inputwrite_enb_reg;
inputempty_0;
inputempty_1;
inputempty_2;
inputfull_0;
inputfull_1;
inputfull_2;
output[2:0]write_enb;
outputfifo_empty;
outputfifo_full;
outputvld_out_0;
outputvld_out_1;
outputvld_out_2;
//Porttypedeclaration
wireclock;
wireresetn;
wiredetect_add;
wire[1:0]data;
wirewrite_enb_reg;
wireempty_0;
wireempty_1;
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
wireempty_2;
wirefull_0;
wirefull_1;
wirefull_2;
regfifo_empty;
regfifo_full;
wirevld_out_0;
wirevld_out_1;
wirevld_out_2;
reg[1:0]addr;
reg[2:0]write_enb_sel;
//Thisblockwilldetecttheaddressofchannelandwilllatchittill
//packet_validisasserted,addressandwrite_enb_selwillbeusedfor
//latchingtheincomingdataintothefifoofthatchannel.
always@(posedgeclock)
begin
if(resetn==1'b0)
begin
write_enb_sel=3'b000;
addr=2'b11;
end
elseif(detect_add)
begin
case(data)
2'b00:begin
write_enb_sel=3'b001;
addr=2'b00;
end
2'b01:begin
write_enb_sel=3'b010;
addr=2'b01;
end
2'b10:begin
write_enb_sel=3'b100;
addr=2'b10;
end
default:begin
write_enb_sel=3'b000;
addr=2'b11;
end
endcase
end
end
//writeenablegenerationforfifo
assignwrite_enb[0]=((write_enb_sel[0])&&(write_enb_reg));
assignwrite_enb[1]=((write_enb_sel[1])&&(write_enb_reg));
assignwrite_enb[2]=((write_enb_sel[2])&&(write_enb_reg));
//outputdatawillbevalidatchannelswhenvld_outwillbehigh
assignvld_out_0=~empty_0;
assignvld_out_1=~empty_1;
assignvld_out_2=~empty_2;
//fifo_emptyandfifo_fullaregeneratedfromthe
//fullandemptyofthefifo,selectedbyaddressbits
always@(addr,empty_0,empty_1,empty_2,full_0,full_1,full_2)
begin
case(addr)
2'b00:begin
fifo_empty=empty_0;
fifo_full=full_0;
end
2'b01:begin
fifo_empty=empty_1;
fifo_full=full_1;
end
2'b10:begin
fifo_empty=empty_2;
fifo_full=full_2;
end
default:begin
fifo_empty=1'b0;
fifo_full=1'b1;
end
endcase
end
146
147
endmodule
Download
Sponsored links
LOGIN
Filelist
Name
Size
Date
1.96kB
ff_sync.v
Don't have
an account
4.42kB
Register now
Emailaddress
router_reg.v
fsm_router.v
Password
2011-04-0707:22
7.18kB
2010-08-1802:59
Mail to:
6.11kB
support@codeforge.com
Forgot password
Remember me
fifo_rtl.v
5.03kB
router_1x3.v
...
2010-08-1803:00
2010-08-1802:58
4.67kB
2011-09-2623:29
Login
Sponsored links
Pleaseinputkeywords
Search
Elapsed:28.165ms 5.199
0.0
2 point
rtl.zip
Favorite
Share