1 | //-------------------------------------------------------------------------- |
---|
2 | // -- |
---|
3 | // OneWireMaster -- |
---|
4 | // A synthesizable 1-wire master peripheral -- |
---|
5 | // Copyright 1999-2005 Dallas Semiconductor Corporation -- |
---|
6 | // -- |
---|
7 | //-------------------------------------------------------------------------- |
---|
8 | // -- |
---|
9 | // Purpose: Provides timing and control of Dallas 1-wire bus -- |
---|
10 | // through a memory-mapped peripheral -- |
---|
11 | // File: OWM.v -- |
---|
12 | // Date: February 1, 2005 -- |
---|
13 | // Version: v2.100 -- |
---|
14 | // Authors: Rick Downs and Charles Hill, -- |
---|
15 | // Dallas Semiconductor Corporation -- |
---|
16 | // -- |
---|
17 | // Note: This source code is available for use without license. -- |
---|
18 | // Dallas Semiconductor is not responsible for the -- |
---|
19 | // functionality or utility of this product. -- |
---|
20 | // -- |
---|
21 | // Rev: Added Overdrive, Bit control, and strong pullup control -- |
---|
22 | // along with many other features described in the new spec -- |
---|
23 | // released version 2.0 9/5/01 - Greg Glennon -- |
---|
24 | // Significant changes to improve synthesis - English -- |
---|
25 | // Ported to Verilog - Sandelin -- |
---|
26 | //-------------------------------------------------------------------------- |
---|
27 | |
---|
28 | module OWM ( |
---|
29 | ADDRESS, ADS_bar, CLK, EN_bar, MR, RD_bar, WR_bar, /*DDIR, DOUT,*/ INTR, |
---|
30 | STPZ, DATA_IN, DATA_OUT, |
---|
31 | DQ0_T, DQ1_T, DQ2_T, DQ3_T, DQ4_T, DQ5_T, DQ6_T, DQ7_T, |
---|
32 | DQ0_O, DQ1_O, DQ2_O, DQ3_O, DQ4_O, DQ5_O, DQ6_O, DQ7_O, |
---|
33 | DQ0_I, DQ1_I, DQ2_I, DQ3_I, DQ4_I, DQ5_I, DQ6_I, DQ7_I); |
---|
34 | |
---|
35 | input [2:0] ADDRESS; // SFR address |
---|
36 | input ADS_bar; // address latch control (active low) |
---|
37 | input CLK; // system clock |
---|
38 | input EN_bar; // SFR access enable (active low) |
---|
39 | input MR; // master reset |
---|
40 | input RD_bar; // SFR read (active low) |
---|
41 | input WR_bar; // SFR write (active low) |
---|
42 | |
---|
43 | //output DDIR; |
---|
44 | //output [7:0] DOUT; |
---|
45 | output INTR; // one wire master interrupt |
---|
46 | output STPZ; // strong pullup (active low) |
---|
47 | |
---|
48 | input [7:0] DATA_IN; // input DATA bus |
---|
49 | output [7:0] DATA_OUT; // output DATA bus |
---|
50 | |
---|
51 | output DQ0_T; |
---|
52 | output DQ1_T; |
---|
53 | output DQ2_T; |
---|
54 | output DQ3_T; |
---|
55 | output DQ4_T; |
---|
56 | output DQ5_T; |
---|
57 | output DQ6_T; |
---|
58 | output DQ7_T; |
---|
59 | |
---|
60 | output DQ0_O; |
---|
61 | output DQ1_O; |
---|
62 | output DQ2_O; |
---|
63 | output DQ3_O; |
---|
64 | output DQ4_O; |
---|
65 | output DQ5_O; |
---|
66 | output DQ6_O; |
---|
67 | output DQ7_O; |
---|
68 | |
---|
69 | input DQ0_I; |
---|
70 | input DQ1_I; |
---|
71 | input DQ2_I; |
---|
72 | input DQ3_I; |
---|
73 | input DQ4_I; |
---|
74 | input DQ5_I; |
---|
75 | input DQ6_I; |
---|
76 | input DQ7_I; |
---|
77 | |
---|
78 | wire [2:0] dq_sel; |
---|
79 | |
---|
80 | wire [7:0] DIN; |
---|
81 | wire [7:0] DOUT; |
---|
82 | wire [7:0] rcvr_buffer; |
---|
83 | wire [7:0] xmit_buffer; |
---|
84 | wire [2:0] ADDRESS; |
---|
85 | wire clk_1us; |
---|
86 | |
---|
87 | one_wire_io xone_wire_io |
---|
88 | ( |
---|
89 | .CLK(CLK), |
---|
90 | .DDIR(DDIR), |
---|
91 | .DOUT(DOUT), |
---|
92 | .DQ_CONTROL(DQ_CONTROL), |
---|
93 | .MR(MR), |
---|
94 | .DIN(DIN), |
---|
95 | .DQ_IN(DQ_IN), |
---|
96 | .DATA_IN(DATA_IN), |
---|
97 | .DATA_OUT(DATA_OUT), |
---|
98 | .DQ0_T(DQ0_T), |
---|
99 | .DQ0_O(DQ0_O), |
---|
100 | .DQ0_I(DQ0_I), |
---|
101 | |
---|
102 | |
---|
103 | .DQ1_T(DQ1_T), |
---|
104 | .DQ1_O(DQ1_O), |
---|
105 | .DQ1_I(DQ1_I), |
---|
106 | |
---|
107 | |
---|
108 | .DQ2_T(DQ2_T), |
---|
109 | .DQ2_O(DQ2_O), |
---|
110 | .DQ2_I(DQ2_I), |
---|
111 | |
---|
112 | |
---|
113 | .DQ3_T(DQ3_T), |
---|
114 | .DQ3_O(DQ3_O), |
---|
115 | .DQ3_I(DQ3_I), |
---|
116 | |
---|
117 | |
---|
118 | .DQ4_T(DQ4_T), |
---|
119 | .DQ4_O(DQ4_O), |
---|
120 | .DQ4_I(DQ4_I), |
---|
121 | |
---|
122 | |
---|
123 | .DQ5_T(DQ5_T), |
---|
124 | .DQ5_O(DQ5_O), |
---|
125 | .DQ5_I(DQ5_I), |
---|
126 | |
---|
127 | |
---|
128 | .DQ6_T(DQ6_T), |
---|
129 | .DQ6_O(DQ6_O), |
---|
130 | .DQ6_I(DQ6_I), |
---|
131 | |
---|
132 | |
---|
133 | .DQ7_T(DQ7_T), |
---|
134 | .DQ7_O(DQ7_O), |
---|
135 | .DQ7_I(DQ7_I), |
---|
136 | |
---|
137 | |
---|
138 | .DQ_SEL(dq_sel) |
---|
139 | ); |
---|
140 | |
---|
141 | clk_prescaler xclk_prescaler |
---|
142 | ( |
---|
143 | .CLK(CLK), |
---|
144 | .CLK_EN(CLK_EN), |
---|
145 | .div_1(div_1), |
---|
146 | .div_2(div_2), |
---|
147 | .div_3(div_3), |
---|
148 | .MR(MR), |
---|
149 | .pre_0(pre_0), |
---|
150 | .pre_1(pre_1), |
---|
151 | .clk_1us(clk_1us) |
---|
152 | ); |
---|
153 | |
---|
154 | one_wire_interface xone_wire_interface |
---|
155 | ( |
---|
156 | .ADDRESS(ADDRESS), |
---|
157 | .ADS_bar(ADS_bar), |
---|
158 | .clear_interrupts(clear_interrupts), |
---|
159 | .DIN(DIN), |
---|
160 | .DQ_IN(DQ_IN), |
---|
161 | .EN_bar(EN_bar), |
---|
162 | .FSM_CLK(FSM_CLK), |
---|
163 | .MR(MR), |
---|
164 | .OneWireIO_eq_Load(OneWireIO_eq_Load), |
---|
165 | .pdr(pdr), |
---|
166 | .OW_LOW(OW_LOW), |
---|
167 | .OW_SHORT(OW_SHORT), |
---|
168 | .rbf(rbf), |
---|
169 | .rcvr_buffer(rcvr_buffer), |
---|
170 | .RD_bar(RD_bar), |
---|
171 | .reset_owr(reset_owr), |
---|
172 | .rsrf(rsrf), |
---|
173 | .temt(temt), |
---|
174 | .WR_bar(WR_bar), |
---|
175 | .BIT_CTL(BIT_CTL), |
---|
176 | .CLK_EN(CLK_EN), |
---|
177 | .clr_activate_intr(clr_activate_intr), |
---|
178 | .DDIR(DDIR), |
---|
179 | .div_1(div_1), |
---|
180 | .div_2(div_2), |
---|
181 | .div_3(div_3), |
---|
182 | .DOUT(DOUT), |
---|
183 | .EN_FOW(EN_FOW), |
---|
184 | .EOWL(EOWL), |
---|
185 | .EOWSH(EOWSH), |
---|
186 | .epd(epd), |
---|
187 | .erbf(erbf), |
---|
188 | .ersf(ersf), |
---|
189 | .etbe(etbe), |
---|
190 | .etmt(etmt), |
---|
191 | .FOW(FOW), |
---|
192 | .ias(ias), |
---|
193 | .LLM(LLM), |
---|
194 | .OD(OD), |
---|
195 | .owr(owr), |
---|
196 | .pd(pd), |
---|
197 | .PPM(PPM), |
---|
198 | .pre_0(pre_0), |
---|
199 | .pre_1(pre_1), |
---|
200 | .rbf_reset(rbf_reset), |
---|
201 | .sr_a(sr_a), |
---|
202 | .STP_SPLY(STP_SPLY), |
---|
203 | .STPEN(STPEN), |
---|
204 | .tbe(tbe), |
---|
205 | .xmit_buffer(xmit_buffer), |
---|
206 | .dq_sel(dq_sel) |
---|
207 | ); |
---|
208 | |
---|
209 | onewiremaster xonewiremaster( |
---|
210 | .BIT_CTL(BIT_CTL), |
---|
211 | .clk(CLK), |
---|
212 | .clk_1us_en(clk_1us), |
---|
213 | .clr_activate_intr(clr_activate_intr), |
---|
214 | .DQ_IN(DQ_IN), |
---|
215 | .EN_FOW(EN_FOW), |
---|
216 | .EOWL(EOWL), |
---|
217 | .EOWSH(EOWSH), |
---|
218 | .epd(epd), |
---|
219 | .erbf(erbf), |
---|
220 | .ersf(ersf), |
---|
221 | .etbe(etbe), |
---|
222 | .etmt(etmt), |
---|
223 | .FOW(FOW), |
---|
224 | .ias(ias), |
---|
225 | .LLM(LLM), |
---|
226 | .MR(MR), |
---|
227 | .OD(OD), |
---|
228 | .owr(owr), |
---|
229 | .pd(pd), |
---|
230 | .PPM(PPM), |
---|
231 | .rbf_reset(rbf_reset), |
---|
232 | .sr_a(sr_a), |
---|
233 | .STP_SPLY(STP_SPLY), |
---|
234 | .STPEN(STPEN), |
---|
235 | .tbe(tbe), |
---|
236 | .xmit_buffer(xmit_buffer), |
---|
237 | .clear_interrupts(clear_interrupts), |
---|
238 | .DQ_CONTROL(DQ_CONTROL), |
---|
239 | .FSM_CLK(FSM_CLK), |
---|
240 | .INTR(INTR), |
---|
241 | .OneWireIO_eq_Load(OneWireIO_eq_Load), |
---|
242 | .OW_LOW(OW_LOW), |
---|
243 | .OW_SHORT(OW_SHORT), |
---|
244 | .pdr(pdr), |
---|
245 | .rbf(rbf), |
---|
246 | .rcvr_buffer(rcvr_buffer), |
---|
247 | .reset_owr(reset_owr), |
---|
248 | .rsrf(rsrf), |
---|
249 | .STPZ(STPZ), |
---|
250 | .temt(temt) |
---|
251 | ); |
---|
252 | |
---|
253 | |
---|
254 | //synthesis attribute clock_signal of clk_1us IS no |
---|
255 | |
---|
256 | //synthesis attribute buffer_type of clk_1us IS none |
---|
257 | |
---|
258 | |
---|
259 | endmodule |
---|