abcbus.sv 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. module abcbus (
  2. input rst_n,
  3. input sys_clk,
  4. input sdram_clk, // Assumed to be a multiple of sys_clk
  5. input stb_1mhz, // 1-2 MHz sys_clk strobe
  6. // CPU interface
  7. input abc_valid, // Control/status registers
  8. input map_valid, // Memory map
  9. input [31:0] cpu_addr,
  10. input [31:0] cpu_wdata,
  11. input [3:0] cpu_wstrb,
  12. output reg [31:0] cpu_rdata, // For the ABC-bus control
  13. output [31:0] cpu_rdata_map, // For the map RAM
  14. output reg irq,
  15. // ABC bus
  16. inout abc_clk,
  17. output abc_clk_s,
  18. inout [15:0] abc_a,
  19. inout [7:0] abc_d,
  20. output reg abc_d_oe,
  21. inout abc_rst_n,
  22. inout abc_cs_n,
  23. inout [4:0] abc_out_n,
  24. inout [1:0] abc_inp_n,
  25. inout abc_xmemfl_n,
  26. inout abc_xmemw800_n, // Memory write strobe (ABC800)
  27. inout abc_xmemw80_n, // Memory write strobe (ABC80)
  28. inout abc_xinpstb_n, // I/O read strobe (ABC800)
  29. inout abc_xoutpstb_n, // I/O write strobe (ABC80)
  30. // The following are inverted versus the bus IF
  31. // the corresponding MOSFETs are installed
  32. inout abc_rdy_x, // RDY = WAIT#
  33. inout abc_resin_x, // System reset request
  34. inout abc_int80_x, // System INT request (ABC80)
  35. inout abc_int800_x, // System INT request (ABC800)
  36. inout abc_nmi_x, // System NMI request (ABC800)
  37. inout abc_xm_x, // System memory override (ABC800)
  38. // Host/device control
  39. output abc_host, // 1 = host, 0 = device
  40. // ABC-bus extension header
  41. // (Note: cannot use an array here because HC and HH are
  42. // input only.)
  43. inout exth_ha,
  44. inout exth_hb,
  45. input exth_hc,
  46. inout exth_hd,
  47. inout exth_he,
  48. inout exth_hf,
  49. inout exth_hg,
  50. input exth_hh,
  51. // SDRAM interface
  52. output [24:0] sdram_addr,
  53. input [7:0] sdram_rd,
  54. output reg sdram_valid,
  55. input sdram_ready,
  56. output [7:0] sdram_wd,
  57. output reg sdram_wstrb
  58. );
  59. // Set if MOSFETs Q1-Q6 are installed rather than the corresponding
  60. // resistors. BOTH CANNOT BE INSTALLED AT THE SAME TIME.
  61. parameter [6:1] mosfet_installed = 6'b111_111;
  62. parameter [0:0] exth_reversed = 1'b0;
  63. // Synchronizer for ABC-bus input signals; also changes
  64. // the sense to positive logic where applicable
  65. wire [15:0] abc_a_s;
  66. wire [7:0] abc_di;
  67. wire abc_rst_s;
  68. wire abc_cs_s;
  69. wire [4:0] abc_out_s;
  70. wire [1:0] abc_inp_s;
  71. wire abc_xmemfl_s;
  72. wire abc_xmemw800_s;
  73. wire abc_xmemw80_s;
  74. wire abc_xinpstb_s;
  75. wire abc_xoutpstb_s;
  76. synchronizer #( .width(39) ) abc_synchro
  77. (
  78. .rst_n ( rst_n ),
  79. .clk ( sys_clk ),
  80. .d ( { abc_clk, abc_a, abc_d, ~abc_rst_n, ~abc_cs_n,
  81. ~abc_out_n, ~abc_inp_n, ~abc_xmemfl_n, ~abc_xmemw800_n,
  82. ~abc_xmemw80_n, ~abc_xinpstb_n, ~abc_xoutpstb_n } ),
  83. .q ( { abc_clk_s, abc_a_s, abc_di, abc_rst_s, abc_cs_s,
  84. abc_out_s, abc_inp_s, abc_xmemfl_s, abc_xmemw800_s,
  85. abc_xmemw80_s, abc_xinpstb_s, abc_xoutpstb_s } )
  86. );
  87. // Only support device mode for now (v2 cards could support host mode)
  88. assign abc_host = 1'b0;
  89. reg abc_clk_active;
  90. // On ABC800, only one of XINPSTB# or XOUTPSTB# will be active;
  91. // on ABC80 they will either be 00 or ZZ; in the latter case pulled
  92. // low by external resistors.
  93. wire abc80 = abc_xinpstb_s & abc_xoutpstb_s;
  94. wire abc800 = ~abc80;
  95. // Memory and I/O read/write strobes for ABC-bus
  96. reg abc_xmemrd;
  97. reg abc_xmemwr;
  98. reg [1:0] abc_inp;
  99. reg [4:0] abc_out;
  100. reg abc_rst;
  101. reg abc_cs;
  102. reg [3:1] abc_stb; // Delayed strobes
  103. always @(posedge sdram_clk)
  104. begin
  105. abc_xmemrd <= abc_clk_active & abc_xmemfl_s;
  106. abc_xmemwr <= abc_clk_active &
  107. (abc800 ? abc_xmemw800_s : abc_xmemw80_s);
  108. abc_inp <= abc_inp_s & {2{abc_clk_active}};
  109. abc_out <= abc_out_s & {5{abc_clk_active}};
  110. abc_rst <= abc_rst_s & abc_clk_active;
  111. abc_cs <= abc_cs_s & abc_clk_active;
  112. abc_stb <= { abc_stb, |{abc_inp, abc_out, abc_rst,
  113. abc_cs, abc_xmemrd, abc_xmemwr} };
  114. end
  115. reg [7:0] abc_do;
  116. assign abc_d = abc_d_oe ? abc_do : 8'hzz;
  117. reg [8:0] ioselx;
  118. wire iosel_en = ioselx[8];
  119. wire [5:0] iosel = ioselx[5:0];
  120. // ABC-bus I/O select
  121. always @(negedge rst_n or posedge sdram_clk)
  122. if (~rst_n)
  123. ioselx <= 9'b0;
  124. else if (abc_rst)
  125. ioselx <= 9'b0;
  126. else if (abc_cs)
  127. ioselx <= { 1'b1, abc_di };
  128. // Open drain signals with optional MOSFETs
  129. reg abc_wait = 1'b1; // Power up asserted; see below
  130. reg abc_int = 1'b0;
  131. reg abc_nmi = 1'b0;
  132. reg abc_resin = 1'b0;
  133. reg abc_xm = 1'b0;
  134. function reg opt_mosfet(input signal, input mosfet);
  135. if (mosfet)
  136. opt_mosfet = signal;
  137. else
  138. opt_mosfet = signal ? 1'b0 : 1'bz;
  139. endfunction // opt_mosfet
  140. assign abc_int80_x = opt_mosfet(abc_int & abc80, mosfet_installed[1]);
  141. assign abc_rdy_x = opt_mosfet(abc_wait, mosfet_installed[2]);
  142. assign abc_nmi_x = opt_mosfet(abc_nmi, mosfet_installed[3]);
  143. assign abc_resin_x = opt_mosfet(abc_resin, mosfet_installed[4]);
  144. assign abc_int800_x = opt_mosfet(abc_int & abc800, mosfet_installed[5]);
  145. assign abc_xm_x = opt_mosfet(abc_xm, mosfet_installed[6]);
  146. // Detect ABC-bus clock: need a minimum frequency of 84/64 MHz
  147. // to be considered live.
  148. reg [2:0] abc_clk_ctr;
  149. reg [1:0] abc_clk_q;
  150. always @(negedge rst_n or posedge sys_clk)
  151. if (~rst_n)
  152. begin
  153. abc_clk_q <= 2'b0;
  154. abc_clk_ctr <= 3'b0;
  155. abc_clk_active <= 1'b0;
  156. end
  157. else
  158. begin
  159. abc_clk_q <= { abc_clk_q[0], abc_clk_s };
  160. case ( { abc_clk_q == 2'b10, stb_1mhz } )
  161. 2'b10: begin
  162. if (abc_clk_ctr == 3'b111)
  163. abc_clk_active <= 1'b1;
  164. else
  165. abc_clk_ctr <= abc_clk_ctr + 1'b1;
  166. end
  167. 2'b01: begin
  168. if (abc_clk_ctr == 3'b000)
  169. abc_clk_active <= 1'b0;
  170. else
  171. abc_clk_ctr <= abc_clk_ctr - 1'b1;
  172. end
  173. default: begin
  174. // nothing
  175. end
  176. endcase // case ( {(abc_clk_q == 2'10), sys_clk_stb[6]} )
  177. end // else: !if(~rst_n)
  178. // ABC-bus extension header (exth_c and exth_h are input only)
  179. // The naming of pins is kind of nonsensical:
  180. //
  181. // +3V3 - 1 2 - +3V3
  182. // HA - 3 4 - HE
  183. // HB - 5 6 - HG
  184. // HC - 7 8 - HH
  185. // HD - 9 10 - HF
  186. // GND - 11 12 - GND
  187. //
  188. // This layout allows the header to be connected on either side
  189. // of the board. This logic assigns the following names to the pins;
  190. // if the ext_reversed is set to 1 then the left and right sides
  191. // are flipped.
  192. //
  193. // +3V3 - 1 2 - +3V3
  194. // exth[0] - 3 4 - exth[1]
  195. // exth[2] - 5 6 - exth[3]
  196. // exth[6] - 7 8 - exth[7]
  197. // exth[4] - 9 10 - exth[5]
  198. // GND - 11 12 - GND
  199. wire [7:0] exth_d; // Input data
  200. wire [5:0] exth_q; // Output data
  201. wire [5:0] exth_oe; // Output enable
  202. assign exth_d[0] = exth_reversed ? exth_he : exth_ha;
  203. assign exth_d[1] = exth_reversed ? exth_ha : exth_he;
  204. assign exth_d[2] = exth_reversed ? exth_hg : exth_hb;
  205. assign exth_d[3] = exth_reversed ? exth_hb : exth_hg;
  206. assign exth_d[4] = exth_reversed ? exth_hf : exth_hd;
  207. assign exth_d[5] = exth_reversed ? exth_hd : exth_hf;
  208. assign exth_d[6] = exth_reversed ? exth_hh : exth_hc;
  209. assign exth_d[7] = exth_reversed ? exth_hc : exth_hh;
  210. wire [2:0] erx = { 2'b00, exth_reversed };
  211. assign exth_ha = exth_oe[3'd0 ^ erx] ? exth_q[3'd0 ^ erx] : 1'bz;
  212. assign exth_he = exth_oe[3'd1 ^ erx] ? exth_q[3'd1 ^ erx] : 1'bz;
  213. assign exth_hb = exth_oe[3'd2 ^ erx] ? exth_q[3'd2 ^ erx] : 1'bz;
  214. assign exth_hg = exth_oe[3'd3 ^ erx] ? exth_q[3'd3 ^ erx] : 1'bz;
  215. assign exth_hd = exth_oe[3'd4 ^ erx] ? exth_q[3'd4 ^ erx] : 1'bz;
  216. assign exth_hf = exth_oe[3'd5 ^ erx] ? exth_q[3'd5 ^ erx] : 1'bz;
  217. assign exth_q = 6'b0;
  218. assign exth_oe = 6'b0;
  219. // ABC SDRAM interface
  220. //
  221. // Memory map for ABC-bus memory references.
  222. // 512 byte granularity for memory (registers 0-127),
  223. // one input and one output queue per select code for I/O (128-255).
  224. //
  225. // bit [15:0] = SDRAM address [24:9] ( bits 24:9 from CPU )
  226. // bit [16] = write enable ( bit 30 from CPU )
  227. // bit [17] = read enable ( bit 31 from CPU )
  228. //
  229. // Accesses from the internal CPU supports 32-bit accesses only!
  230. //
  231. wire [17:0] rdata_abcmemmap;
  232. wire [17:0] abc_memmap_rd;
  233. abcmapram abcmapram (
  234. .aclr ( ~rst_n ),
  235. .clock ( sdram_clk ),
  236. .address_a ( abc_a_s[15:9] ),
  237. .data_a ( 18'bx ),
  238. .wren_a ( 1'b0 ),
  239. .q_a ( abc_memmap_rd ),
  240. .address_b ( cpu_addr[8:2] ),
  241. .data_b ( { cpu_wdata[31:30], cpu_wdata[24:9] } ),
  242. .wren_b ( map_valid & cpu_wstrb[0] ),
  243. .q_b ( rdata_abcmemmap )
  244. );
  245. assign cpu_rdata_map = { rdata_abcmemmap[17:16], 5'b0,
  246. rdata_abcmemmap[15:0], 9'b0 };
  247. wire abc_rden = abc_memmap_rd[17];
  248. wire abc_wren = abc_memmap_rd[16];
  249. wire [24:0] abc_memaddr = { abc_memmap_rd[15:0], abc_a_s[8:0] };
  250. reg abc_memrd_en;
  251. reg abc_memwr_en;
  252. reg abc_do_memrd;
  253. reg abc_do_memwr;
  254. always @(posedge sdram_clk or negedge rst_n)
  255. if (~rst_n)
  256. begin
  257. abc_memrd_en <= 1'b0;
  258. abc_memwr_en <= 1'b0;
  259. abc_do_memrd <= 1'b0;
  260. abc_do_memwr <= 1'b0;
  261. sdram_valid <= 1'b0;
  262. sdram_wstrb <= 1'b0;
  263. end
  264. else
  265. begin
  266. // Careful with the registering here: need to make sure
  267. // abcmapram is caught up for I/O; for memory the address
  268. // will have been stable for some time
  269. abc_memwr_en <= abc_xmemwr;
  270. abc_memrd_en <= abc_xmemrd;
  271. abc_do_memrd <= abc_rden & abc_memrd_en;
  272. abc_do_memwr <= abc_wren & abc_memwr_en;
  273. sdram_valid <= abc_do_memrd | abc_do_memwr;
  274. sdram_wstrb <= abc_do_memwr;
  275. end // else: !if(~rst_n)
  276. assign sdram_addr = abc_memaddr;
  277. assign sdram_wd = abc_di;
  278. // I/O data registers; RST# is considered OUT 7 even through
  279. // it is an IN from the ABC point of view.
  280. //
  281. // OUT register, written from ABC: <addr 2:0> <data 7:0>
  282. // IN register, written from CPU: <enable 1:0> <status 7:0> <inp 7:0>
  283. // Busy register:
  284. //
  285. // [7:0] - busy OUT status (write-1-clear)
  286. // [9:8] - busy IN status (write-1-clear)
  287. // [15:12] - bus status change (write-1-clear)
  288. // same bit positions as the bus status register
  289. //
  290. // [23:16] - busy OUT mask
  291. // [25:24] - busy IN mask
  292. // [31:28] - bus status change IRQ enable
  293. //
  294. // Assert WAIT# (deassert RDY) if the masked busy status is nonzero
  295. // and an busy-unmasked I/O comes in.
  296. //
  297. // An IRQ is generated if the masked busy status is nonzero.
  298. //
  299. reg [9:0] busy_status;
  300. reg [9:0] busy_mask;
  301. reg [9:0] busy_io_q;
  302. reg [1:0] inp_en;
  303. reg [3:0] bus_change_status;
  304. reg [3:0] bus_change_mask;
  305. wire [9:0] is_io = { abc_inp[1:0], abc_rst, 1'b0,
  306. abc_out[4:1], abc_cs, abc_out[0] };
  307. wire [9:0] busy_io = is_io & busy_mask;
  308. wire is_busy = |(busy_status & busy_mask);
  309. wire [9:0] busy_valid = 10'b11_1011_1111;
  310. wire [9:0] set_busy = busy_io_q & ~busy_io;
  311. always @(posedge sys_clk or negedge rst_n)
  312. if (~rst_n)
  313. busy_io_q <= 10'b0;
  314. else
  315. busy_io_q <= busy_io;
  316. // WAIT# logic
  317. reg abc_wait_force = 1'b1; // Power up asserted; ignores rst_n
  318. always @(posedge sys_clk)
  319. abc_wait <= abc_wait_force | (rst_n & |set_busy & is_busy);
  320. //
  321. // I/O data registers
  322. //
  323. reg [2:0] reg_out_addr;
  324. reg [7:0] reg_out_data;
  325. reg [7:0] reg_inp_data[0:1];
  326. // OUT logic
  327. always @(posedge sdram_clk)
  328. begin
  329. if (|busy_io[7:0])
  330. begin
  331. reg_out_data <= abc_di;
  332. case (busy_io[7:0])
  333. 8'b0000_0001: reg_out_addr <= 3'd0;
  334. 8'b0000_0010: reg_out_addr <= 3'd1;
  335. 8'b0000_0100: reg_out_addr <= 3'd2;
  336. 8'b0000_1000: reg_out_addr <= 3'd3;
  337. 8'b0001_0000: reg_out_addr <= 3'd4;
  338. 8'b0010_0000: reg_out_addr <= 3'd5;
  339. 8'b0100_0000: reg_out_addr <= 3'd6;
  340. 8'b1000_0000: reg_out_addr <= 3'd7;
  341. default: reg_out_addr <= 3'dx;
  342. endcase // case (busy_io)
  343. end // if (|busy_io[7:0])
  344. end // always @ (posedge sdram_clk)
  345. //
  346. // ABC data out (= ABC host read) logic
  347. //
  348. always @(negedge rst_n or posedge sdram_clk)
  349. if (~rst_n)
  350. begin
  351. abc_d_oe <= 1'b0;
  352. abc_do <= 8'bx;
  353. end
  354. else
  355. begin
  356. abc_d_oe <= 1'b0;
  357. abc_do <= sdram_rd;
  358. if (abc_do_memrd)
  359. begin
  360. // Drive the output bus even if sdram_rd doesn't yet have
  361. // valid data (i.e. sdram_ready = 0).
  362. // The propagation delay for OE#/DIR for 74HC245 is about
  363. // twice what it is for data.
  364. abc_d_oe <= 1'b1;
  365. abc_do <= sdram_rd;
  366. end
  367. else if (abc_inp[0] & inp_en[0])
  368. begin
  369. abc_d_oe <= 1'b1;
  370. abc_do <= reg_inp_data[0];
  371. end
  372. else if (abc_inp[1] & inp_en[1])
  373. begin
  374. abc_d_oe <= 1'b1;
  375. abc_do <= reg_inp_data[1];
  376. end
  377. end // else: !if(~rst_n)
  378. // Memory read latency counter
  379. reg [7:0] memrd_latency_ctr = 'b0;
  380. reg [7:0] memrd_latency_max = 'b0;
  381. reg memrd_latency_err = 1'b0;
  382. wire [7:0] memrd_latency_ctr_next = memrd_latency_ctr + 1'b1;
  383. always @(posedge sdram_clk)
  384. begin
  385. if (abc_do_memrd & ~sdram_ready)
  386. begin
  387. memrd_latency_ctr <= memrd_latency_ctr_next;
  388. if (memrd_latency_max == memrd_latency_ctr)
  389. memrd_latency_max <= memrd_latency_ctr_next;
  390. // If abc_xmemrd goes away, then we missed our time
  391. // window... this is bad.
  392. if (~abc_xmemrd)
  393. memrd_latency_err <= 1'b1;
  394. end // else: !if(~abc_do_memrd)
  395. else if (~abc_do_memrd)
  396. begin
  397. memrd_latency_ctr <= 'b0;
  398. end
  399. end // always @ (posedge sdram_clk)
  400. // Bus status
  401. reg [3:0] abc_status[0:1];
  402. always @(posedge sys_clk)
  403. begin
  404. abc_status[0] <= { 1'b0, abc800, abc_rst_s, abc_clk_active };
  405. abc_status[1] <= abc_status[0];
  406. end
  407. wire [3:0] bus_change = (abc_status[0] ^ abc_status[1]) & bus_change_mask;
  408. wire [3:0] bus_change_valid = 4'b0111;
  409. //
  410. // Busy/IRQ status and CPU register writes
  411. //
  412. always @(posedge sys_clk or negedge rst_n)
  413. if (~rst_n)
  414. begin
  415. busy_status <= 10'b0;
  416. busy_mask <= 10'h082; // Enable hold on RST# and CS#
  417. inp_en <= 2'b00;
  418. bus_change_status <= 4'b0;
  419. bus_change_mask <= 4'b0;
  420. // abc_resin, nmi, int and force_wait are deliberately not affected
  421. // by an internal CPU reset. They are, however, inherently asserted
  422. // when the FPGA is configured, and initialized to fixed values
  423. // at configuration time (RESIN# asserted, the others deasserted.)
  424. end
  425. else
  426. begin
  427. busy_status <= busy_status | set_busy;
  428. bus_change_status <= bus_change_status | bus_change;
  429. if (abc_valid)
  430. begin
  431. casez (cpu_addr[5:2] )
  432. 5'b??010: begin
  433. if (cpu_wstrb[0])
  434. busy_status[7:0] <= set_busy[7:0] | (busy_status[7:0] & ~cpu_wdata[7:0]);
  435. if (cpu_wstrb[1])
  436. begin
  437. busy_status[9:8] <= set_busy[9:8] | (busy_status[9:8] & ~cpu_wdata[9:8]);
  438. bus_change_status <= bus_change | (bus_change_status & ~cpu_wdata[15:12]);
  439. end
  440. if (cpu_wstrb[2])
  441. busy_mask[7:0] <= cpu_wdata[23:16] & busy_valid[7:0];
  442. if (cpu_wstrb[3])
  443. begin
  444. busy_mask[9:8] <= cpu_wdata[25:24] & busy_valid[9:8];
  445. bus_change_mask <= cpu_wdata[31:28] & bus_change_valid;
  446. end
  447. end
  448. 5'b??011: begin
  449. if (cpu_wstrb[0])
  450. begin
  451. abc_resin <= cpu_wdata[3];
  452. abc_nmi <= cpu_wdata[2];
  453. abc_int <= cpu_wdata[1];
  454. abc_wait_force <= cpu_wdata[0];
  455. end
  456. end
  457. 5'b??101: begin
  458. if (cpu_wstrb[0])
  459. reg_inp_data[0] <= cpu_wdata[7:0];
  460. if (cpu_wstrb[1])
  461. reg_inp_data[1] <= cpu_wdata[15:8];
  462. if (cpu_wstrb[2])
  463. inp_en <= cpu_wdata[17:16];
  464. end
  465. default:
  466. /* do nothing */ ;
  467. endcase // casez (cpu_addr[5:2])
  468. end // if (abc_valid & cpu_wstrb[0])
  469. end
  470. // Level triggered IRQ
  471. always @(posedge sys_clk)
  472. irq <= is_busy | |(bus_change_status & bus_change_mask);
  473. // Read MUX
  474. always_comb
  475. casez (cpu_addr[6:2])
  476. 5'b00000: cpu_rdata = { 28'b0, abc_status[0] };
  477. 5'b00001: cpu_rdata = { 23'b0, ~iosel_en, ioselx[7:0] };
  478. 5'b00010: cpu_rdata = { bus_change_mask, 2'b0, busy_mask,
  479. bus_change_status, 2'b0, busy_status };
  480. 5'b00011: cpu_rdata = { 28'b0, abc_resin, abc_nmi, abc_int, abc_wait };
  481. 5'b00100: cpu_rdata = { 21'b0, reg_out_addr, reg_out_data };
  482. 5'b00101: cpu_rdata = { 14'b0, inp_en, reg_inp_data[1], reg_inp_data[0] };
  483. 5'b00111: cpu_rdata = { 23'b0, memrd_latency_err, memrd_latency_max };
  484. default: cpu_rdata = 32'bx;
  485. endcase // casez (cpu_addr[5:2])
  486. endmodule // abcbus