|
11 | 11 | "board": "icezum", |
12 | 12 | "graph": { |
13 | 13 | "blocks": [ |
| 14 | + { |
| 15 | + "id": "01c30fd4-6162-425e-9af0-2f40273021fa", |
| 16 | + "type": "basic.output", |
| 17 | + "data": { |
| 18 | + "name": "", |
| 19 | + "virtual": true |
| 20 | + }, |
| 21 | + "position": { |
| 22 | + "x": 1056, |
| 23 | + "y": 24 |
| 24 | + } |
| 25 | + }, |
14 | 26 | { |
15 | 27 | "id": "aef86b17-5dea-4001-9cce-0fc7f1c58c33", |
16 | 28 | "type": "basic.output", |
17 | 29 | "data": { |
18 | | - "name": "rxClk" |
| 30 | + "name": "rxClk", |
| 31 | + "virtual": true |
19 | 32 | }, |
20 | 33 | "position": { |
21 | | - "x": 816, |
22 | | - "y": 96 |
| 34 | + "x": 1056, |
| 35 | + "y": 144 |
| 36 | + } |
| 37 | + }, |
| 38 | + { |
| 39 | + "id": "c2df35e2-6b64-4b6b-b29b-9d66b6115158", |
| 40 | + "type": "basic.output", |
| 41 | + "data": { |
| 42 | + "name": "", |
| 43 | + "virtual": true |
| 44 | + }, |
| 45 | + "position": { |
| 46 | + "x": 1056, |
| 47 | + "y": 264 |
23 | 48 | } |
24 | 49 | }, |
25 | 50 | { |
26 | 51 | "id": "5fb29465-2ee7-45bb-afa4-9a3de895c774", |
27 | 52 | "type": "basic.input", |
28 | 53 | "data": { |
29 | | - "name": "clk" |
| 54 | + "name": "clk", |
| 55 | + "virtual": true, |
| 56 | + "clock": true |
| 57 | + }, |
| 58 | + "position": { |
| 59 | + "x": 40, |
| 60 | + "y": 328 |
| 61 | + } |
| 62 | + }, |
| 63 | + { |
| 64 | + "id": "531f63ad-0c27-425d-82de-96e038bf38ec", |
| 65 | + "type": "basic.output", |
| 66 | + "data": { |
| 67 | + "name": "", |
| 68 | + "virtual": true |
30 | 69 | }, |
31 | 70 | "position": { |
32 | | - "x": 32, |
33 | | - "y": 216 |
| 71 | + "x": 1056, |
| 72 | + "y": 384 |
34 | 73 | } |
35 | 74 | }, |
36 | 75 | { |
37 | 76 | "id": "49ed377b-71f0-4d1b-a73b-62a59341ca8b", |
38 | 77 | "type": "basic.output", |
39 | 78 | "data": { |
40 | | - "name": "txClk" |
| 79 | + "name": "txClk", |
| 80 | + "virtual": true |
41 | 81 | }, |
42 | 82 | "position": { |
43 | | - "x": 816, |
44 | | - "y": 336 |
| 83 | + "x": 1056, |
| 84 | + "y": 504 |
| 85 | + } |
| 86 | + }, |
| 87 | + { |
| 88 | + "id": "0a0ab721-9757-4d4f-8e2e-3a88705e9b4a", |
| 89 | + "type": "basic.output", |
| 90 | + "data": { |
| 91 | + "name": "", |
| 92 | + "virtual": true |
| 93 | + }, |
| 94 | + "position": { |
| 95 | + "x": 1056, |
| 96 | + "y": 624 |
45 | 97 | } |
46 | 98 | }, |
47 | 99 | { |
48 | 100 | "id": "ba573190-2ead-411a-a323-1b15a22d46db", |
49 | 101 | "type": "basic.code", |
50 | 102 | "data": { |
51 | | - "code": "/*\n * Baud rate generator to divide {CLOCK_RATE} (internal system clock) into\n * {BAUD_RATE} tx/rx pair, with rx oversample by default 16x\n */\n\nparameter CLOCK_RATE = 100000000;\nparameter BAUD_RATE = 9600;\nparameter RX_OVERSAMPLE_RATE = 16;\n\nlocalparam RX_ACC_MAX = CLOCK_RATE / (2 * BAUD_RATE * RX_OVERSAMPLE_RATE);\nlocalparam TX_ACC_MAX = CLOCK_RATE / (2 * BAUD_RATE);\nlocalparam RX_ACC_WIDTH = $clog2(RX_ACC_MAX);\nlocalparam TX_ACC_WIDTH = $clog2(TX_ACC_MAX);\n\nwire clk;\nreg rxClk;\nreg txClk;\n\nreg [RX_ACC_WIDTH-1:0] rx_counter = 0;\nreg [TX_ACC_WIDTH-1:0] tx_counter = 0;\n\ninitial begin\n rxClk = 1'b0;\n txClk = 1'b0;\nend\n\nalways @(posedge clk) begin\n // rx clock\n if (rx_counter == RX_ACC_MAX[RX_ACC_WIDTH-1:0]) begin\n rx_counter <= 0;\n rxClk <= ~rxClk;\n end else begin\n rx_counter <= rx_counter + 1'b1;\n end\n\n // tx clock\n if (tx_counter == TX_ACC_MAX[TX_ACC_WIDTH-1:0]) begin\n tx_counter <= 0;\n txClk <= ~txClk;\n end else begin\n tx_counter <= tx_counter + 1'b1;\n end\nend\n\nassign clk = pin1_clk;\nassign pin8_rxClk = rxClk;\nassign pin9_txClk = txClk;\n", |
| 103 | + "code": "/*\n * Baud rate generator to divide {CLOCK_RATE} (internal system clock) into\n * {BAUD_RATE} tx/rx pair, with rx oversample by default 16x\n */\n\nparameter CLOCK_RATE = 100000000;\nparameter BAUD_RATE = 9600;\nparameter RX_OVERSAMPLE_RATE = 16;\n\nlocalparam RX_ACC_MAX = CLOCK_RATE / (2 * BAUD_RATE * RX_OVERSAMPLE_RATE);\nlocalparam TX_ACC_MAX = CLOCK_RATE / (2 * BAUD_RATE);\nlocalparam RX_ACC_WIDTH = $clog2(RX_ACC_MAX);\nlocalparam TX_ACC_WIDTH = $clog2(TX_ACC_MAX);\n\nwire clk;\nreg rxClk;\nreg txClk;\n\nreg [RX_ACC_WIDTH-1:0] rx_counter = 0;\nreg [TX_ACC_WIDTH-1:0] tx_counter = 0;\n\ninitial begin\n rxClk = 1'b0;\n txClk = 1'b0;\nend\n\nalways @(posedge clk) begin\n // rx clock\n if (rx_counter == RX_ACC_MAX[RX_ACC_WIDTH-1:0]) begin\n rx_counter <= 0;\n rxClk <= ~rxClk;\n end else begin\n rx_counter <= rx_counter + 1'b1;\n end\n\n // tx clock\n if (tx_counter == TX_ACC_MAX[TX_ACC_WIDTH-1:0]) begin\n tx_counter <= 0;\n txClk <= ~txClk;\n end else begin\n tx_counter <= tx_counter + 1'b1;\n end\nend\n\nassign clk = pin1_clk;\nassign pin3_rxClk = rxClk;\nassign pin6_txClk = txClk;\n", |
52 | 104 | "params": [], |
53 | 105 | "ports": { |
54 | 106 | "in": [ |
|
58 | 110 | ], |
59 | 111 | "out": [ |
60 | 112 | { |
61 | | - "name": "pin8_rxClk" |
| 113 | + "name": "pin2_NC" |
| 114 | + }, |
| 115 | + { |
| 116 | + "name": "pin3_rxClk" |
| 117 | + }, |
| 118 | + { |
| 119 | + "name": "pin4_NC" |
| 120 | + }, |
| 121 | + { |
| 122 | + "name": "pin5_NC" |
62 | 123 | }, |
63 | 124 | { |
64 | | - "name": "pin9_txClk" |
| 125 | + "name": "pin6_txClk" |
| 126 | + }, |
| 127 | + { |
| 128 | + "name": "pin7_NC" |
65 | 129 | } |
66 | 130 | ] |
67 | 131 | } |
68 | 132 | }, |
69 | 133 | "position": { |
70 | 134 | "x": 280, |
71 | | - "y": 8 |
| 135 | + "y": 0 |
72 | 136 | }, |
73 | 137 | "size": { |
74 | | - "width": 388, |
75 | | - "height": 480 |
| 138 | + "width": 636, |
| 139 | + "height": 712 |
76 | 140 | } |
77 | 141 | } |
78 | 142 | ], |
|
90 | 154 | { |
91 | 155 | "source": { |
92 | 156 | "block": "ba573190-2ead-411a-a323-1b15a22d46db", |
93 | | - "port": "pin8_rxClk" |
| 157 | + "port": "pin2_NC" |
| 158 | + }, |
| 159 | + "target": { |
| 160 | + "block": "01c30fd4-6162-425e-9af0-2f40273021fa", |
| 161 | + "port": "in" |
| 162 | + } |
| 163 | + }, |
| 164 | + { |
| 165 | + "source": { |
| 166 | + "block": "ba573190-2ead-411a-a323-1b15a22d46db", |
| 167 | + "port": "pin3_rxClk" |
94 | 168 | }, |
95 | 169 | "target": { |
96 | 170 | "block": "aef86b17-5dea-4001-9cce-0fc7f1c58c33", |
|
100 | 174 | { |
101 | 175 | "source": { |
102 | 176 | "block": "ba573190-2ead-411a-a323-1b15a22d46db", |
103 | | - "port": "pin9_txClk" |
| 177 | + "port": "pin4_NC" |
| 178 | + }, |
| 179 | + "target": { |
| 180 | + "block": "c2df35e2-6b64-4b6b-b29b-9d66b6115158", |
| 181 | + "port": "in" |
| 182 | + } |
| 183 | + }, |
| 184 | + { |
| 185 | + "source": { |
| 186 | + "block": "ba573190-2ead-411a-a323-1b15a22d46db", |
| 187 | + "port": "pin5_NC" |
| 188 | + }, |
| 189 | + "target": { |
| 190 | + "block": "531f63ad-0c27-425d-82de-96e038bf38ec", |
| 191 | + "port": "in" |
| 192 | + } |
| 193 | + }, |
| 194 | + { |
| 195 | + "source": { |
| 196 | + "block": "ba573190-2ead-411a-a323-1b15a22d46db", |
| 197 | + "port": "pin6_txClk" |
104 | 198 | }, |
105 | 199 | "target": { |
106 | 200 | "block": "49ed377b-71f0-4d1b-a73b-62a59341ca8b", |
107 | 201 | "port": "in" |
108 | 202 | } |
| 203 | + }, |
| 204 | + { |
| 205 | + "source": { |
| 206 | + "block": "ba573190-2ead-411a-a323-1b15a22d46db", |
| 207 | + "port": "pin7_NC" |
| 208 | + }, |
| 209 | + "target": { |
| 210 | + "block": "0a0ab721-9757-4d4f-8e2e-3a88705e9b4a", |
| 211 | + "port": "in" |
| 212 | + } |
109 | 213 | } |
110 | 214 | ] |
111 | 215 | } |
|
0 commit comments