Upload
adirisingsun
View
215
Download
0
Embed Size (px)
Citation preview
8/16/2019 Fsm_router.v - Free Open Source Codes - CodeForge
1/4
Login Sign up | FavoriteSource Codes Point Help LanguageUpload
Home » Source Code » rouiter design using verilog » fsm_router.v
By udimudi 2015‐01‐10 View s :1 Download s :2 Point s : 2 Rate:0.0
fsm_router.v File view
From: rouiter design using verilog
Description:design router using verilog.design a 1x3 router using verilog.
1
2
3
4
5
6
7
8
9
10
11
12
1314
15
16
17
18
19
20
21
22
23
24
25
26
27
2829
30
31
32
33
34
35
36
37
38
39
40
41
42
4344
45
46
47
48
49
50
51
52
53
54
55
56
57
58
5960
61
62
63
64
65
/************************************************************************
MAVEN SILICON CONFIDENTIAL ‐ This is an unpublished, proprietary work
of Maven Silicon Softech Pvt. Ltd., Bangalore, and is fully protected
under copyright and trade secret laws. You may not view, use, disclose,
copy, or distribute this file or any information contained herein except
pursuant to a valid written license from Maven Silicon Softech Pvt. Ltd.,
Bangalore
Design Name : router_1x3
Module Name : fsm_router
Date : 19/09/2009
Author : P R SIVAKUMAR
Email : [email protected] Company : Maven Silicon, Bangalore www.vlsitraining.com
Version : 1.0 revision 0.0
************************************************************************/
//‐‐‐‐‐‐‐‐‐‐‐‐‐ STATE DEFINITIONS ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐
`define DECODE_ADDRESS 4'd0
`define LOAD_FIRST_DATA 4'd1
`define LOAD_DATA 4'd2
`define LOAD_PARITY 4'd3
`define FIFO_FULL_STATE 4'd4
`define LOAD_AFTER_FULL 4'd5
`define WAIT_TILL_EMPTY 4'd6
`define CHECK_PARITY_ERROR 4'd7
//‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ ‐‐‐
module fsm_router ( clock,
busy,
fifo_empty,
fifo_full,
packet_valid,
data_in,
parity_done,
low_packet_valid,
detect_add,
write_enb_reg,
resetn,
lp_state,
ld_state, laf_state,
lfd_state,
full_state,
reset_int_reg
);
input clock;
input fifo_empty;
input fifo_full;
input packet_valid;
input [1:0] data_in;
input parity_done;
input low_packet_valid;
input resetn;
output busy;output detect_add;
output write_enb_reg;
output lp_state;
output ld_state;
output laf_state;
output lfd_state;
http://www.codeforge.com/http://www.codeforge.com/http://www.codeforge.com/article/248808http://www.codeforge.com/http://www.codeforge.com/pointhttp://www.codeforge.com/help/cfhttp://void%280%29/http://www.codeforge.com/http://www.codeforge.com/article/248808#introductionhttp://www.codeforge.com/article/248808http://www.codeforge.com/article/248808http://www.codeforge.com/codelisthttp://www.codeforge.com/http://www.codeforge.com/help/cfhttp://www.codeforge.com/pointhttp://www.codeforge.com/http://www.codeforge.com/http://www.codeforge.com/user/registration/registerhttp://void%280%29/
8/16/2019 Fsm_router.v - Free Open Source Codes - CodeForge
2/4
66
67
68
69
70
71
72
73
74
75
76
77
7879
80
81
82
83
84
85
86
87
88
89
90
91
92
9394
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
124125
126
127
128
129
130
131
132
133
134
135
136
137
138
139140
141
142
143
144
145
output full_state;
output reset_int_reg;
// Port Signals
wire clock;
wire busy;
wire fifo_empty;
wire fifo_full;
wire packet_valid;
wire [1:0] data_in;
wire parity_done;
wire low_packet_valid;
wire resetn; wire write_enb_reg;
wire detect_add; // This signal stimulates the sampling of address
wire lp_state; // indicates current_state is LOAD_PARITY
wire ld_state; // indicates cur_state is LOAD_DATA
wire laf_state; // indicates cur_state is LOAD_AFTER_FULL
wire lfd_state; // indicates cur_state is LOAD_FIRST_DATA
wire reset_int_reg; // resets internal registers to initial zero value
wire full_state; // indicates cur_stateis FULL_STATE;
//internal signals
reg [2:0] cur_state;
reg [2:0] next_state;
always@(posedge clock) begin
if (resetn == 1'b0)
cur_state
8/16/2019 Fsm_router.v - Free Open Source Codes - CodeForge
3/4
File list Tips: You can preview the content of files by clicking file names^_^
0
ff_sync.v
router_reg.vfsm_router.v
router_1x3.v
fifo_rtl.v
Want complete source code? Download it herePoint
s
: 2
Download
Sponsored links
Name Size Date
1.96 kB
4.42 kB 2010-08-18 03:00
5.03 kB 2011-04-07 07:227.18 kB 2010-08-18 02:59
6.11 kB 2010-08-18 02:58
4.67 kB 2011-09-26 23:29
...
< 1 >
Sponsored links
146
147
148
149
150
151
152
153
154
155
156
157
158159
160
161
162
163
164
165
166
167
168
169
170
171
172
173174
175
176
177
178
179
180
next_state = `LOAD_DATA;
end
`WAIT_TILL_EMPTY : begin
if (fifo_empty == 1'b0)
next_state = `WAIT_TILL_EMPTY;
else
next_state = `LOAD_FIRST_DATA;
end
`CHECK_PARITY_ERROR : begin
next_state = `DECODE_ADDRESS;
end
default : next_state = `DECODE_ADDRESS;
endcase end
//Output Logic
assign detect_add = (cur_state==`DECODE_ADDRESS) ? 1'b1 : 1'b0;
assign ld_state = (cur_state==`LOAD_DATA) ? 1'b1 : 1'b0;
assign lp_state = (cur_state==`LOAD_PARITY) ? 1'b1 : 1'b0;
assign lfd_state = (cur_state==`LOAD_FIRST_DATA) ? 1'b1 : 1'b0;
assign reset_int_reg = (cur_state==`CHECK_PARITY_ERROR) ? 1'b1 : 1'b0;
assign laf_state = (cur_state==`LOAD_AFTER_FULL) ? 1'b1 : 1'b0;
assign full_state =(cur_state==`FIFO_FULL_STATE);
assign write_enb_reg = ((cur_state == `LOAD_DATA) ||
(cur_state == `LOAD_AFTER_FULL) ||
(cur_state == `LOAD_PARITY)) ? 1'b1 : 1'b0;
assign busy = ((cur_state == `FIFO_FULL_STATE) ||
(cur_state == `LOAD_FIRST_DATA) ||(cur_state == `LOAD_AFTER_FULL) ||
(cur_state == `LOAD_PARITY) ||
(cur_state == `CHECK_PARITY_ERROR) ||
(cur_state == `WAIT_TILL_EMPTY)) ? 1'b1 : 1'b0;
endmodule
Want Faster Mobile Apps?Sign Up for a Free Trial & Begin Optimizing Your Mobile Apps Today.
Please input key words Search
Don't have an account?Register now
Need any help?
Mail to:[email protected]
×LOGIN
Email address
Password
Remember me Forgot password?
Log in
https://www.googleadservices.com/pagead/aclk?sa=L&ai=CR3KH9QU-V4e1EMiPvgTb86ewB7XMmdpEtN6PxeMC4K6vxXgQASDKr4EfYOXK5YO0DqABlJTW0wPIAQOpAt1g324IyE8-qAMByAPBBKoEnwFP0NgOaTA2g_YGcKY0giUeTOoFCJMsO9eRzBbRGLQVo6KMyc5gJ-HuuZ2swFHCQUNkPJ7j0k08ZVmhR8Cz-TOpDdvjLMU88apK1OnMNbWO4AkRiazNRpsmVpTFCzS8-rozGSw2VkrmqX6_0Mv0Ox4lgJjLwJadRuOOfjFWljlbYserl1cAjbb4oEJWc8pg-tcrtMWyWXujbZHfQVzJuPWIBgGgBgOAB9TrqSyoB6a-G9gHAdgTAw&num=1&cid=CAASEuRo3VCxvf88pLLg2vo0zETOaA&sig=AOD64_2ozgyEipiDVoFNFGXoMuWBwlofbg&client=ca-pub-5238775468331658&adurl=http://my.monsterindia.com/create_account.html%3Fspl%3DGDN_JP_IN_Tech_Sites_IT_Sites_Generic_Managed_Placement_16th_May_2016_WEB_D%26WT.mc_n%3Dolm_sk_srch_GDNhttps://www.googleadservices.com/pagead/aclk?sa=L&ai=CR3KH9QU-V4e1EMiPvgTb86ewB7XMmdpEtN6PxeMC4K6vxXgQASDKr4EfYOXK5YO0DqABlJTW0wPIAQOpAt1g324IyE8-qAMByAPBBKoEnwFP0NgOaTA2g_YGcKY0giUeTOoFCJMsO9eRzBbRGLQVo6KMyc5gJ-HuuZ2swFHCQUNkPJ7j0k08ZVmhR8Cz-TOpDdvjLMU88apK1OnMNbWO4AkRiazNRpsmVpTFCzS8-rozGSw2VkrmqX6_0Mv0Ox4lgJjLwJadRuOOfjFWljlbYserl1cAjbb4oEJWc8pg-tcrtMWyWXujbZHfQVzJuPWIBgGgBgOAB9TrqSyoB6a-G9gHAdgTAw&num=1&cid=CAASEuRo3VCxvf88pLLg2vo0zETOaA&sig=AOD64_2ozgyEipiDVoFNFGXoMuWBwlofbg&client=ca-pub-5238775468331658&adurl=http://my.monsterindia.com/create_account.html%3Fspl%3DGDN_JP_IN_Tech_Sites_IT_Sites_Generic_Managed_Placement_16th_May_2016_WEB_D%26WT.mc_n%3Dolm_sk_srch_GDNmailto:[email protected]://www.googleadservices.com/pagead/aclk?sa=L&ai=CR3KH9QU-V4e1EMiPvgTb86ewB7XMmdpEtN6PxeMC4K6vxXgQASDKr4EfYOXK5YO0DqABlJTW0wPIAQOpAt1g324IyE8-qAMByAPBBKoEnwFP0NgOaTA2g_YGcKY0giUeTOoFCJMsO9eRzBbRGLQVo6KMyc5gJ-HuuZ2swFHCQUNkPJ7j0k08ZVmhR8Cz-TOpDdvjLMU88apK1OnMNbWO4AkRiazNRpsmVpTFCzS8-rozGSw2VkrmqX6_0Mv0Ox4lgJjLwJadRuOOfjFWljlbYserl1cAjbb4oEJWc8pg-tcrtMWyWXujbZHfQVzJuPWIBgGgBgOAB9TrqSyoB6a-G9gHAdgTAw&num=1&cid=CAASEuRo3VCxvf88pLLg2vo0zETOaA&sig=AOD64_2ozgyEipiDVoFNFGXoMuWBwlofbg&client=ca-pub-5238775468331658&adurl=http://my.monsterindia.com/create_account.html%3Fspl%3DGDN_JP_IN_Tech_Sites_IT_Sites_Generic_Managed_Placement_16th_May_2016_WEB_D%26WT.mc_n%3Dolm_sk_srch_GDNhttp://www.codeforge.com/read/248808/fsm_router.v__htmlhttp://www.codeforge.com/resetpwmailto:[email protected]://www.codeforge.com/user/registration/registerhttps://www.googleadservices.com/pagead/aclk?sa=L&ai=CR3KH9QU-V4e1EMiPvgTb86ewB7XMmdpEtN6PxeMC4K6vxXgQASDKr4EfYOXK5YO0DqABlJTW0wPIAQOpAt1g324IyE8-qAMByAPBBKoEnwFP0NgOaTA2g_YGcKY0giUeTOoFCJMsO9eRzBbRGLQVo6KMyc5gJ-HuuZ2swFHCQUNkPJ7j0k08ZVmhR8Cz-TOpDdvjLMU88apK1OnMNbWO4AkRiazNRpsmVpTFCzS8-rozGSw2VkrmqX6_0Mv0Ox4lgJjLwJadRuOOfjFWljlbYserl1cAjbb4oEJWc8pg-tcrtMWyWXujbZHfQVzJuPWIBgGgBgOAB9TrqSyoB6a-G9gHAdgTAw&num=1&cid=CAASEuRo3VCxvf88pLLg2vo0zETOaA&sig=AOD64_2ozgyEipiDVoFNFGXoMuWBwlofbg&client=ca-pub-5238775468331658&adurl=http://my.monsterindia.com/create_account.html%3Fspl%3DGDN_JP_IN_Tech_Sites_IT_Sites_Generic_Managed_Placement_16th_May_2016_WEB_D%26WT.mc_n%3Dolm_sk_srch_GDNhttps://www.googleadservices.com/pagead/aclk?sa=L&ai=CcUT18gU-V5axMNaTvgSfx6G4CpGCj9lEqYPMpcwCme3jooQFEAEgyq-BH2DlyuWDtA6gAc-t4NIDyAEBqAMByAPDBKoEoAFP0AO1XEmRPxqJn9UywwISUwaVbnHBBmuoKDhevNSA3g09TtLsy2wrhmi_8DNRdU_rkas9VumcUwv6SBd7RXKzRKDpn2xTgYDk9ZpDcZfWYmTtcqeSVsanA3jxPUoTZ4SVtDkfsTSgn2eLW3hL99q6UGrNL0mGy22aYujjFcXHyuuiEGdP_cBuY4oRcxwBqQZiyXBSTmSK1uXZPTamuTK2iAYBgAeZ0p8tqAemvhvYBwHYEww&num=1&cid=CAASEuRotgZolYPfSlyROC8chaOmwQ&sig=AOD64_2rrebgupC2pR3dPAswtLVRvpKxMg&client=ca-pub-5238775468331658&adurl=https://content.akamai.com/PG4440-Exclusive-Upgrade-Offer-from-Akamai-txt.htmlhttps://www.googleadservices.com/pagead/aclk?sa=L&ai=CcUT18gU-V5axMNaTvgSfx6G4CpGCj9lEqYPMpcwCme3jooQFEAEgyq-BH2DlyuWDtA6gAc-t4NIDyAEBqAMByAPDBKoEoAFP0AO1XEmRPxqJn9UywwISUwaVbnHBBmuoKDhevNSA3g09TtLsy2wrhmi_8DNRdU_rkas9VumcUwv6SBd7RXKzRKDpn2xTgYDk9ZpDcZfWYmTtcqeSVsanA3jxPUoTZ4SVtDkfsTSgn2eLW3hL99q6UGrNL0mGy22aYujjFcXHyuuiEGdP_cBuY4oRcxwBqQZiyXBSTmSK1uXZPTamuTK2iAYBgAeZ0p8tqAemvhvYBwHYEww&num=1&cid=CAASEuRotgZolYPfSlyROC8chaOmwQ&sig=AOD64_2rrebgupC2pR3dPAswtLVRvpKxMg&client=ca-pub-5238775468331658&adurl=https://content.akamai.com/PG4440-Exclusive-Upgrade-Offer-from-Akamai-txt.htmlhttp://www.codeforge.com/read/248808/fifo_rtl.v__htmlhttp://www.codeforge.com/read/248808/router_1x3.v__htmlhttp://www.codeforge.com/read/248808/fsm_router.v__htmlhttp://www.codeforge.com/read/248808/router_reg.v__htmlhttp://www.codeforge.com/read/248808/ff_sync.v__html
8/16/2019 Fsm_router.v - Free Open Source Codes - CodeForge
4/4
© 2014 CodeForge Dev Team All rights reserved. Email:[email protected]
Join us | Contact | Advertisement
Elapsed:33.904ms 5.199
Please input your comm Submit 评分:0.0 2 point Favorite Sharertl.zip
http://www.codeforge.com/help#contacthttp://www.codeforge.com/help#contacthttp://www.codeforge.com/careermailto:[email protected]