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:router_reg
Date:19/09/2009
Description:Thismodulecontainsallthestatus,data
parityregistersrequiredbyrouter_1x3
Author:PRSIVAKUMAR
Email:siva@vlsitraining.com
Company:MavenSilicon,Bangalorewww.vlsitraining.com
Version:1.0revision0.0
*************************************************************************/
modulerouter_reg(clock,
resetn,
packet_valid,
data_in,
fifo_full,
detect_add,
lfd_state,
ld_state,
lp_state,
laf_state,
full_state,
reset_int_reg,
parity_done,
low_packet_valid,
dout,
err
);
inputclock;
inputresetn;
inputpacket_valid;
input[7:0]data_in;
inputfifo_full;
inputreset_int_reg;
inputdetect_add;
inputld_state;
inputlp_state;
inputlfd_state;
inputlaf_state;
inputfull_state;
outputparity_done;
outputlow_packet_valid;
output[7:0]dout;
outputerr;
regparity_done;
reglow_packet_valid;
reg[7:0]dout;
regerr;
//Internalsignals
reg[7:0]first_byte;
reg[7:0]full_state_byte;
reg[7:0]data_parity;
reg[7:0]parity;
regcheck_error;
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
//parity_donestatusregisterstorestheinformation
//thatlastparitybytehasbeendelivered
always@(posedgeclock)
begin
if(resetn==1'b0)
parity_done<=1'b0;
elseif((ld_state&&!fifo_full&&!packet_valid)||
(laf_state&&!parity_done&&low_packet_valid))
parity_done<=1'b1;
elseif(reset_int_reg)
parity_done<=1'b0;
end
//low_packet_validstatusregisterstorestheinformationthat
//forcurrentpackettransmissionpacket_validhasbecomelow,
//toavoidanyconflictionwithhighpacket_validofnexttransmission
always@(posedgeclock)
begin
if(resetn==1'b0)
low_packet_valid<=1'b0;
elseif(ld_state==1&&packet_valid==0)
low_packet_valid<=1'b1;
elseif(reset_int_reg==1)
low_packet_valid<=1'b0;
end
//Dataislatchedfrominputanddata
//issenttofifothroughfsm_dout
always@(posedgeclock)
begin
if(resetn==1'b0)
begin
dout<=8'h00;
first_byte<=8'h00;
full_state_byte<=8'h00;
end
else
begin
if(detect_add&&packet_valid==1)
first_byte<=data_in;
elseif(lfd_state)
dout<=first_byte;
elseif(ld_state&&!fifo_full)
dout<=data_in;
elseif(ld_state&&fifo_full)
full_state_byte<=data_in;
elseif(laf_state)
dout<=full_state_byte;
elseif(lp_state&&!fifo_full)
dout<=data_in;
end
end
//Paritycalculationforincomingdata
always@(posedgeclock)
begin
if(resetn==1'b0)
parity<=8'h00;
else
begin
if(detect_add)
parity<=8'h00;
elseif(lfd_state)
parity<=parity^first_byte;
elseif(ld_state&&!full_state&&packet_valid)
parity<=parity^data_in;
end
end
//Parityofpacketisstoredindata_parityregister
//andcheck_errorsignalgeneration
always@(posedgeclock)
begin
if(resetn==1'b0)
begin
data_parity<=8'b0000_0000;
check_error<=1'b0;
end
elseif(detect_add)
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
begin
data_parity<=8'b0000_0000;
check_error<=1'b0;
end
elseif((ld_state&&!packet_valid)||
(full_state&&!packet_valid))
begin
data_parity<=data_in;
check_error<=1'b1;
end
else
begin
data_parity<=data_parity;
check_error<=1'b0;
end
end
//Errorinparityischeckedbycomparingthecalculated
//parityanddata_paritycomingfromthepacket
always@(posedgeclock)
begin
if(!resetn)
err<=1'b0;
elseif(!check_error)
err<=1'b0;
elseif(data_parity!=parity)
err<=1'b1;
else
err<=1'b0;
end
endmodule
Download
Sponsored links
LOGIN
Filelist
Name
Size
1.96kB
ff_sync.v
Don't have
an account
4.42kB
Register now
Emailaddress
router_reg.v
fsm_router.v
Password
fifo_rtl.v
...
2011-04-0707:22
7.18kB
2010-08-1802:59
Mail to:
6.11kB
support@codeforge.com
Forgot password
Remember me
4.67kB
Login
1
Sponsored links
Start Download
Instant Free Download. Start Here ! Get Bestbackground
Pleaseinputkeywords
2010-08-1803:00
5.03kB
router_1x3.v
Date
Search
2010-08-1802:58
2011-09-2623:29
Elapsed:33.126ms 5.199
0.0
2 point
rtl.zip
Favorite
Share