test_uart.v 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740
  1. // This file is automatically generated, DO NOT modify.
  2. `timescale 1 ps/ 1 ps
  3. module test_uart (
  4. GPIO1_0,
  5. GPIO1_1,
  6. GPIO1_2,
  7. GPIO1_3,
  8. GPIO1_4,
  9. GPIO1_5,
  10. GPIO1_6,
  11. GPIO1_7,
  12. GPIO2_0,
  13. GPIO2_1,
  14. GPIO2_2,
  15. GPIO2_3,
  16. GPIO2_4,
  17. GPIO2_5,
  18. GPIO2_6,
  19. GPIO2_7,
  20. GPIO3_0,
  21. GPIO3_1,
  22. GPIO3_2,
  23. GPIO3_3,
  24. GPIO3_4,
  25. GPIO6_0,
  26. GPIO6_2,
  27. GPIO6_4,
  28. GPIO6_6,
  29. GPIO9_0,
  30. GPIO9_1,
  31. GPIO9_2,
  32. GPIO9_3,
  33. GPIO9_4,
  34. GPIO9_5,
  35. GPIO9_6,
  36. GPIO9_7,
  37. PIN_HSE,
  38. PIN_HSI,
  39. PIN_OSC,
  40. SIM_CLK,
  41. SIM_IO,
  42. SIM_IO_12,
  43. SIM_IO_13,
  44. SIM_IO_14,
  45. SIM_IO_15,
  46. UART4_UARTRXD,
  47. UART4_UARTTXD,
  48. uart14_rx,
  49. uart14_tx,
  50. uart15_rx,
  51. uart15_tx
  52. );
  53. output GPIO1_0;
  54. output GPIO1_1;
  55. output GPIO1_2;
  56. output GPIO1_3;
  57. output GPIO1_4;
  58. output GPIO1_5;
  59. output GPIO1_6;
  60. output GPIO1_7;
  61. output GPIO2_0;
  62. output GPIO2_1;
  63. output GPIO2_2;
  64. output GPIO2_3;
  65. output GPIO2_4;
  66. output GPIO2_5;
  67. output GPIO2_6;
  68. output GPIO2_7;
  69. input GPIO3_0;
  70. input GPIO3_1;
  71. input GPIO3_2;
  72. input GPIO3_3;
  73. input GPIO3_4;
  74. output GPIO6_0;
  75. output GPIO6_2;
  76. output GPIO6_4;
  77. inout GPIO6_6;
  78. output GPIO9_0;
  79. inout GPIO9_1;
  80. output GPIO9_2;
  81. output GPIO9_3;
  82. output GPIO9_4;
  83. output GPIO9_5;
  84. output GPIO9_6;
  85. output GPIO9_7;
  86. input PIN_HSE;
  87. input PIN_HSI;
  88. input PIN_OSC;
  89. output SIM_CLK;
  90. inout [11:0] SIM_IO;
  91. inout SIM_IO_12;
  92. inout SIM_IO_13;
  93. inout SIM_IO_14;
  94. inout SIM_IO_15;
  95. input UART4_UARTRXD;
  96. output UART4_UARTTXD;
  97. input uart14_rx;
  98. output uart14_tx;
  99. input uart15_rx;
  100. output uart15_tx;
  101. // GPIO6_4, GPIO6_4
  102. wire PIN_1_out_en;
  103. wire PIN_1_out_data;
  104. assign GPIO6_4 = PIN_1_out_en ? PIN_1_out_data : 1'bz;
  105. // GPIO2_2, GPIO2_2
  106. wire PIN_15_out_en;
  107. wire PIN_15_out_data;
  108. assign GPIO2_2 = PIN_15_out_en ? PIN_15_out_data : 1'bz;
  109. // GPIO2_6, GPIO2_6
  110. wire PIN_17_out_en;
  111. wire PIN_17_out_data;
  112. assign GPIO2_6 = PIN_17_out_en ? PIN_17_out_data : 1'bz;
  113. // GPIO2_1, GPIO2_1
  114. wire PIN_23_out_en;
  115. wire PIN_23_out_data;
  116. assign GPIO2_1 = PIN_23_out_en ? PIN_23_out_data : 1'bz;
  117. // GPIO2_5, GPIO2_5
  118. wire PIN_25_out_en;
  119. wire PIN_25_out_data;
  120. assign GPIO2_5 = PIN_25_out_en ? PIN_25_out_data : 1'bz;
  121. // GPIO2_0, GPIO2_0
  122. wire PIN_29_out_en;
  123. wire PIN_29_out_data;
  124. assign GPIO2_0 = PIN_29_out_en ? PIN_29_out_data : 1'bz;
  125. // GPIO2_3, GPIO2_3
  126. wire PIN_3_out_en;
  127. wire PIN_3_out_data;
  128. assign GPIO2_3 = PIN_3_out_en ? PIN_3_out_data : 1'bz;
  129. // GPIO2_4, GPIO2_4
  130. wire PIN_31_out_en;
  131. wire PIN_31_out_data;
  132. assign GPIO2_4 = PIN_31_out_en ? PIN_31_out_data : 1'bz;
  133. // GPIO3_4, GPIO3_4
  134. assign PIN_32_in = GPIO3_4;
  135. // GPIO3_3, GPIO3_3
  136. assign PIN_33_in = GPIO3_3;
  137. // GPIO9_5, GPIO9_5
  138. wire PIN_34_out_en;
  139. wire PIN_34_out_data;
  140. assign GPIO9_5 = PIN_34_out_en ? PIN_34_out_data : 1'bz;
  141. // GPIO3_2, GPIO3_2
  142. assign PIN_35_in = GPIO3_2;
  143. // UART4_UARTTXD, GPIO8_6
  144. wire PIN_36_out_en;
  145. wire PIN_36_out_data;
  146. assign UART4_UARTTXD = PIN_36_out_en ? PIN_36_out_data : 1'bz;
  147. // UART4_UARTRXD, GPIO7_1
  148. assign PIN_38_in = UART4_UARTRXD;
  149. // GPIO9_4, GPIO9_4
  150. wire PIN_39_out_en;
  151. wire PIN_39_out_data;
  152. assign GPIO9_4 = PIN_39_out_en ? PIN_39_out_data : 1'bz;
  153. // GPIO9_2, GPIO9_2
  154. wire PIN_46_out_en;
  155. wire PIN_46_out_data;
  156. assign GPIO9_2 = PIN_46_out_en ? PIN_46_out_data : 1'bz;
  157. // GPIO9_0, GPIO9_0
  158. wire PIN_47_out_en;
  159. wire PIN_47_out_data;
  160. assign GPIO9_0 = PIN_47_out_en ? PIN_47_out_data : 1'bz;
  161. // GPIO9_1, GPIO9_1
  162. assign PIN_48_in = GPIO9_1;
  163. wire PIN_48_out_en;
  164. wire PIN_48_out_data;
  165. assign GPIO9_1 = PIN_48_out_en ? PIN_48_out_data : 1'bz;
  166. // GPIO2_7, GPIO2_7
  167. wire PIN_5_out_en;
  168. wire PIN_5_out_data;
  169. assign GPIO2_7 = PIN_5_out_en ? PIN_5_out_data : 1'bz;
  170. // GPIO6_0, GPIO6_0
  171. wire PIN_51_out_en;
  172. wire PIN_51_out_data;
  173. assign GPIO6_0 = PIN_51_out_en ? PIN_51_out_data : 1'bz;
  174. // GPIO6_2, GPIO6_2
  175. wire PIN_52_out_en;
  176. wire PIN_52_out_data;
  177. assign GPIO6_2 = PIN_52_out_en ? PIN_52_out_data : 1'bz;
  178. // GPIO9_7, GPIO9_7
  179. wire PIN_70_out_en;
  180. wire PIN_70_out_data;
  181. assign GPIO9_7 = PIN_70_out_en ? PIN_70_out_data : 1'bz;
  182. // GPIO9_6, GPIO9_6
  183. wire PIN_71_out_en;
  184. wire PIN_71_out_data;
  185. assign GPIO9_6 = PIN_71_out_en ? PIN_71_out_data : 1'bz;
  186. // GPIO1_0, GPIO1_0
  187. wire PIN_78_out_en;
  188. wire PIN_78_out_data;
  189. assign GPIO1_0 = PIN_78_out_en ? PIN_78_out_data : 1'bz;
  190. // GPIO1_4, GPIO1_4
  191. wire PIN_80_out_en;
  192. wire PIN_80_out_data;
  193. assign GPIO1_4 = PIN_80_out_en ? PIN_80_out_data : 1'bz;
  194. // GPIO1_1, GPIO1_1
  195. wire PIN_82_out_en;
  196. wire PIN_82_out_data;
  197. assign GPIO1_1 = PIN_82_out_en ? PIN_82_out_data : 1'bz;
  198. // GPIO1_5, GPIO1_5
  199. wire PIN_84_out_en;
  200. wire PIN_84_out_data;
  201. assign GPIO1_5 = PIN_84_out_en ? PIN_84_out_data : 1'bz;
  202. // GPIO1_2, GPIO1_2
  203. wire PIN_87_out_en;
  204. wire PIN_87_out_data;
  205. assign GPIO1_2 = PIN_87_out_en ? PIN_87_out_data : 1'bz;
  206. // GPIO1_6, GPIO1_6
  207. wire PIN_89_out_en;
  208. wire PIN_89_out_data;
  209. assign GPIO1_6 = PIN_89_out_en ? PIN_89_out_data : 1'bz;
  210. // GPIO1_3, GPIO1_3
  211. wire PIN_91_out_en;
  212. wire PIN_91_out_data;
  213. assign GPIO1_3 = PIN_91_out_en ? PIN_91_out_data : 1'bz;
  214. // GPIO1_7, GPIO1_7
  215. wire PIN_93_out_en;
  216. wire PIN_93_out_data;
  217. assign GPIO1_7 = PIN_93_out_en ? PIN_93_out_data : 1'bz;
  218. // GPIO3_0, GPIO3_0
  219. assign PIN_95_in = GPIO3_0;
  220. // GPIO9_3, GPIO9_3
  221. wire PIN_96_out_en;
  222. wire PIN_96_out_data;
  223. assign GPIO9_3 = PIN_96_out_en ? PIN_96_out_data : 1'bz;
  224. // GPIO3_1, GPIO3_1
  225. assign PIN_97_in = GPIO3_1;
  226. // GPIO6_6, GPIO6_6
  227. assign PIN_98_in = GPIO6_6;
  228. wire PIN_98_out_en;
  229. wire PIN_98_out_data;
  230. assign GPIO6_6 = PIN_98_out_en ? PIN_98_out_data : 1'bz;
  231. // PIN_HSE
  232. assign PIN_HSE_in = PIN_HSE;
  233. // PIN_HSI
  234. assign PIN_HSI_in = PIN_HSI;
  235. // PIN_OSC
  236. assign PIN_OSC_in = PIN_OSC;
  237. wire sys_gck;
  238. wire [4:0] PLL_CLKOUT;
  239. (* keep = 1 *) wire PLL_ENABLE;
  240. (* keep = 1 *) wire PLL_LOCK;
  241. (* keep = 1 *) wire sys_resetn;
  242. (* keep = 1 *) wire sys_ctrl_stop;
  243. (* keep = 1 *) wire [1:0] sys_ctrl_clkSource;
  244. `ifdef ALTA_SYN
  245. alta_pllve pll_inst (
  246. .clkin(PIN_HSE_in),
  247. .pfden(1'b1),
  248. .resetn(PLL_ENABLE),
  249. .phasecounterselect(3'b0),
  250. .phaseupdown(1'b0),
  251. .phasestep(1'b0),
  252. .phasedone(),
  253. .scanclk(1'b0),
  254. .scanclkena(1'b0),
  255. .scandata(1'b0),
  256. .scandataout(),
  257. .scandone(),
  258. .configupdate(1'b0),
  259. .clkfb(pll_clkfb),
  260. .clkfbout(pll_clkfb),
  261. .clkout0(PLL_CLKOUT[0]),
  262. .clkout1(PLL_CLKOUT[1]),
  263. .clkout2(PLL_CLKOUT[2]),
  264. .clkout3(PLL_CLKOUT[3]),
  265. .clkout4(PLL_CLKOUT[4]),
  266. .lock (PLL_LOCK));
  267. defparam pll_inst.CLKIN_FREQ = "8.0";
  268. defparam pll_inst.CLKIN_HIGH = 8'd0;
  269. defparam pll_inst.CLKIN_LOW = 8'd0;
  270. defparam pll_inst.CLKIN_TRIM = 1'b0;
  271. defparam pll_inst.CLKIN_BYPASS = 1'b0;
  272. defparam pll_inst.CLKFB_HIGH = 8'd59;
  273. defparam pll_inst.CLKFB_LOW = 8'd59;
  274. defparam pll_inst.CLKFB_TRIM = 1'b0;
  275. defparam pll_inst.CLKFB_BYPASS = 1'b0;
  276. defparam pll_inst.CLKDIV0_EN = 1'b1;
  277. defparam pll_inst.CLKDIV1_EN = 1'b0;
  278. defparam pll_inst.CLKDIV2_EN = 1'b0;
  279. defparam pll_inst.CLKDIV3_EN = 1'b1;
  280. defparam pll_inst.CLKDIV4_EN = 1'b0;
  281. defparam pll_inst.CLKOUT0_HIGH = 8'd0;
  282. defparam pll_inst.CLKOUT0_LOW = 8'd0;
  283. defparam pll_inst.CLKOUT0_TRIM = 1'b0;
  284. defparam pll_inst.CLKOUT0_BYPASS = 1'b0;
  285. defparam pll_inst.CLKOUT0_DEL = 8'd0;
  286. defparam pll_inst.CLKOUT0_PHASE = 3'd0;
  287. defparam pll_inst.CLKOUT1_HIGH = 8'd255;
  288. defparam pll_inst.CLKOUT1_LOW = 8'd255;
  289. defparam pll_inst.CLKOUT1_TRIM = 1'b0;
  290. defparam pll_inst.CLKOUT1_BYPASS = 1'b0;
  291. defparam pll_inst.CLKOUT1_DEL = 8'd0;
  292. defparam pll_inst.CLKOUT1_PHASE = 3'd0;
  293. defparam pll_inst.CLKOUT2_HIGH = 8'd255;
  294. defparam pll_inst.CLKOUT2_LOW = 8'd255;
  295. defparam pll_inst.CLKOUT2_TRIM = 1'b0;
  296. defparam pll_inst.CLKOUT2_BYPASS = 1'b0;
  297. defparam pll_inst.CLKOUT2_DEL = 8'd0;
  298. defparam pll_inst.CLKOUT2_PHASE = 3'd0;
  299. defparam pll_inst.CLKOUT3_HIGH = 8'd1;
  300. defparam pll_inst.CLKOUT3_LOW = 8'd1;
  301. defparam pll_inst.CLKOUT3_TRIM = 1'b0;
  302. defparam pll_inst.CLKOUT3_BYPASS = 1'b0;
  303. defparam pll_inst.CLKOUT3_DEL = 8'd0;
  304. defparam pll_inst.CLKOUT3_PHASE = 3'd0;
  305. defparam pll_inst.CLKOUT4_HIGH = 8'd255;
  306. defparam pll_inst.CLKOUT4_LOW = 8'd255;
  307. defparam pll_inst.CLKOUT4_TRIM = 1'b0;
  308. defparam pll_inst.CLKOUT4_BYPASS = 1'b0;
  309. defparam pll_inst.CLKOUT4_DEL = 8'd0;
  310. defparam pll_inst.CLKOUT4_PHASE = 3'd0;
  311. defparam pll_inst.FEEDBACK_MODE = 3'b100;
  312. defparam pll_inst.CLKOUT1_CASCADE = 1'b0;
  313. defparam pll_inst.CLKOUT2_CASCADE = 1'b0;
  314. defparam pll_inst.CLKOUT3_CASCADE = 1'b0;
  315. defparam pll_inst.CLKOUT4_CASCADE = 1'b0;
  316. defparam pll_inst.FBDELAY_VAL = 3'b100;
  317. defparam pll_inst.VCO_POST_DIV = 1'b1;
  318. `else
  319. altpll pll_inst (
  320. .areset(!PLL_ENABLE),
  321. .inclk ({1'b0, PIN_HSE_in}),
  322. .clk (PLL_CLKOUT),
  323. .locked(PLL_LOCK));
  324. defparam pll_inst.bandwidth_type = "AUTO";
  325. defparam pll_inst.clk0_divide_by = 4;
  326. defparam pll_inst.clk0_multiply_by = 120;
  327. defparam pll_inst.clk0_phase_shift = "0";
  328. defparam pll_inst.clk1_divide_by = 4;
  329. defparam pll_inst.clk1_multiply_by = 120;
  330. defparam pll_inst.clk1_phase_shift = "0";
  331. defparam pll_inst.clk2_divide_by = 4;
  332. defparam pll_inst.clk2_multiply_by = 120;
  333. defparam pll_inst.clk2_phase_shift = "0";
  334. defparam pll_inst.clk3_divide_by = 8;
  335. defparam pll_inst.clk3_multiply_by = 120;
  336. defparam pll_inst.clk3_phase_shift = "0";
  337. defparam pll_inst.clk4_divide_by = 4;
  338. defparam pll_inst.clk4_multiply_by = 120;
  339. defparam pll_inst.clk4_phase_shift = "0";
  340. defparam pll_inst.compensate_clock = "CLK0";
  341. defparam pll_inst.inclk0_input_frequency = 125000;
  342. defparam pll_inst.lpm_type = "altpll";
  343. defparam pll_inst.operation_mode = "NORMAL";
  344. defparam pll_inst.pll_type = "AUTO";
  345. defparam pll_inst.intended_device_family = "Cyclone IV E";
  346. defparam pll_inst.port_areset = "PORT_USED";
  347. defparam pll_inst.port_inclk0 = "PORT_USED";
  348. defparam pll_inst.port_locked = "PORT_USED";
  349. defparam pll_inst.port_clk0 = "PORT_USED";
  350. defparam pll_inst.port_clk1 = "PORT_UNUSED";
  351. defparam pll_inst.port_clk2 = "PORT_UNUSED";
  352. defparam pll_inst.port_clk3 = "PORT_USED";
  353. defparam pll_inst.port_clk4 = "PORT_UNUSED";
  354. defparam pll_inst.width_clock = 5;
  355. defparam pll_inst.width_phasecounterselect = 3;
  356. `endif
  357. assign usb0_xcvr_clk = 1'b1;
  358. `ifdef ALTA_SYN
  359. alta_gclkgen \PLL_CLKOUT[3]_gclkgen (
  360. .clkin(PLL_CLKOUT[3]),
  361. .ena(1'b1),
  362. .clkout(bus_clk_gclkgen)
  363. );
  364. alta_io_gclk \bus_clk_gclk (
  365. .inclk(bus_clk_gclkgen),
  366. .outclk(bus_clk)
  367. );
  368. `else
  369. cycloneive_clkctrl #(
  370. .clock_type ("Global Clock"),
  371. .ena_register_mode("falling edge")
  372. ) \bus_clk_gclk (
  373. .clkselect(2'b00),
  374. .ena(1'b1),
  375. .inclk({3'b0, PLL_CLKOUT[3]}),
  376. .outclk(bus_clk)
  377. );
  378. `endif
  379. // Location: BBOX_X22_Y4_N0 FIXED_COORD
  380. alta_gclksw gclksw_inst (
  381. .resetn(sys_resetn),
  382. .ena (1'b1),
  383. .clkin0(PIN_HSI_in),
  384. .clkin1(PIN_HSE_in),
  385. .clkin2(PLL_CLKOUT[0]),
  386. .clkin3(),
  387. .select(sys_ctrl_clkSource),
  388. .clkout(sys_clk));
  389. `ifdef ALTA_SYN
  390. (* keep = 1 *) alta_gclkgen gclksw_gen (
  391. .clkin (sys_clk),
  392. .ena (1'b1),
  393. .clkout(sys_gck0));
  394. // Location: CLKCTRL_G5 FIXED_COORD
  395. (* keep = 1 *) alta_io_gclk gclksw_gclk (
  396. .inclk (sys_gck0),
  397. .outclk(sys_gck));
  398. `else
  399. assign sys_gck = sys_clk;
  400. `endif
  401. wire [1:0] mem_ahb_htrans;
  402. wire mem_ahb_hready;
  403. wire mem_ahb_hwrite;
  404. wire [31:0] mem_ahb_haddr;
  405. wire [2:0] mem_ahb_hsize;
  406. wire [2:0] mem_ahb_hburst;
  407. wire [31:0] mem_ahb_hwdata;
  408. wire mem_ahb_hreadyout;
  409. wire mem_ahb_hresp;
  410. wire [31:0] mem_ahb_hrdata;
  411. wire slave_ahb_hsel;
  412. wire slave_ahb_hready;
  413. wire slave_ahb_hreadyout;
  414. wire [1:0] slave_ahb_htrans;
  415. wire [2:0] slave_ahb_hsize;
  416. wire [2:0] slave_ahb_hburst;
  417. wire slave_ahb_hwrite;
  418. wire [31:0] slave_ahb_haddr;
  419. wire [31:0] slave_ahb_hwdata;
  420. wire slave_ahb_hresp;
  421. wire [31:0] slave_ahb_hrdata;
  422. wire [3:0] ext_dma_DMACBREQ;
  423. wire [3:0] ext_dma_DMACLBREQ;
  424. wire [3:0] ext_dma_DMACSREQ;
  425. wire [3:0] ext_dma_DMACLSREQ;
  426. wire [3:0] ext_dma_DMACCLR;
  427. wire [3:0] ext_dma_DMACTC;
  428. wire [3:0] local_int;
  429. multi_uart_ip macro_inst(
  430. .SIM_CLK (SIM_CLK ),
  431. .SIM_IO ({SIM_IO[11], SIM_IO[10], SIM_IO[9], SIM_IO[8], SIM_IO[7], SIM_IO[6], SIM_IO[5], SIM_IO[4], SIM_IO[3], SIM_IO[2], SIM_IO[1], SIM_IO[0]}),
  432. .SIM_IO_12 (SIM_IO_12 ),
  433. .SIM_IO_13 (SIM_IO_13 ),
  434. .SIM_IO_14 (SIM_IO_14 ),
  435. .SIM_IO_15 (SIM_IO_15 ),
  436. .uart14_rx (uart14_rx ),
  437. .uart14_tx (uart14_tx ),
  438. .uart15_rx (uart15_rx ),
  439. .uart15_tx (uart15_tx ),
  440. .gpio_int_g0_in ({gpio_int_g0_in__5__, gpio_int_g0_in__4__, gpio_int_g0_in__3__, gpio_int_g0_in__2__, gpio_int_g0_in__1__, gpio_int_g0_in__0__} ),
  441. .gpio_int_g1_in ({gpio_int_g1_in__5__, gpio_int_g1_in__4__, gpio_int_g1_in__3__, gpio_int_g1_in__2__, gpio_int_g1_in__1__, gpio_int_g1_in__0__} ),
  442. .rxd_12_ip_in (rxd_12_ip_in ),
  443. .rxd_13_ip_in (rxd_13_ip_in ),
  444. .rxd_14_ip_in (rxd_14_ip_in ),
  445. .rxd_15_ip_in (rxd_15_ip_in ),
  446. .txd_12_ip_out_data (txd_12_ip_out_data ),
  447. .txd_12_ip_out_en (txd_12_ip_out_en ),
  448. .txd_13_ip_out_data (txd_13_ip_out_data ),
  449. .txd_13_ip_out_en (txd_13_ip_out_en ),
  450. .txd_14_ip_out_data (txd_14_ip_out_data ),
  451. .txd_14_ip_out_en (txd_14_ip_out_en ),
  452. .txd_15_ip_out_data (txd_15_ip_out_data ),
  453. .txd_15_ip_out_en (txd_15_ip_out_en ),
  454. .txen_12_ip_out_data(txen_12_ip_out_data ),
  455. .txen_12_ip_out_en (txen_12_ip_out_en ),
  456. .txen_13_ip_out_data(txen_13_ip_out_data ),
  457. .txen_13_ip_out_en (txen_13_ip_out_en ),
  458. .txen_14_ip_out_data(txen_14_ip_out_data ),
  459. .txen_14_ip_out_en (txen_14_ip_out_en ),
  460. .txen_15_ip_out_data(txen_15_ip_out_data ),
  461. .txen_15_ip_out_en (txen_15_ip_out_en ),
  462. .sys_clock (sys_gck ),
  463. .bus_clock (bus_clk ),
  464. .resetn (sys_resetn ),
  465. .stop (sys_ctrl_stop ),
  466. .mem_ahb_htrans (mem_ahb_htrans ),
  467. .mem_ahb_hready (mem_ahb_hready ),
  468. .mem_ahb_hwrite (mem_ahb_hwrite ),
  469. .mem_ahb_haddr (mem_ahb_haddr ),
  470. .mem_ahb_hsize (mem_ahb_hsize ),
  471. .mem_ahb_hburst (mem_ahb_hburst ),
  472. .mem_ahb_hwdata (mem_ahb_hwdata ),
  473. .mem_ahb_hreadyout (mem_ahb_hreadyout ),
  474. .mem_ahb_hresp (mem_ahb_hresp ),
  475. .mem_ahb_hrdata (mem_ahb_hrdata ),
  476. .slave_ahb_hsel (slave_ahb_hsel ),
  477. .slave_ahb_hready (slave_ahb_hready ),
  478. .slave_ahb_hreadyout(slave_ahb_hreadyout ),
  479. .slave_ahb_htrans (slave_ahb_htrans ),
  480. .slave_ahb_hsize (slave_ahb_hsize ),
  481. .slave_ahb_hburst (slave_ahb_hburst ),
  482. .slave_ahb_hwrite (slave_ahb_hwrite ),
  483. .slave_ahb_haddr (slave_ahb_haddr ),
  484. .slave_ahb_hwdata (slave_ahb_hwdata ),
  485. .slave_ahb_hresp (slave_ahb_hresp ),
  486. .slave_ahb_hrdata (slave_ahb_hrdata ),
  487. .ext_dma_DMACBREQ (ext_dma_DMACBREQ ),
  488. .ext_dma_DMACLBREQ (ext_dma_DMACLBREQ ),
  489. .ext_dma_DMACSREQ (ext_dma_DMACSREQ ),
  490. .ext_dma_DMACLSREQ (ext_dma_DMACLSREQ ),
  491. .ext_dma_DMACCLR (ext_dma_DMACCLR ),
  492. .ext_dma_DMACTC (ext_dma_DMACTC ),
  493. .local_int (local_int )
  494. );
  495. wire [7:0] gpio0_io_out_data;
  496. wire [7:0] gpio0_io_out_en;
  497. wire [7:0] gpio0_io_in = {1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0};
  498. (* keep = 1 *) wire [7:0] gpio1_io_out_data;
  499. (* keep = 1 *) wire [7:0] gpio1_io_out_en;
  500. assign PIN_78_out_data = gpio1_io_out_data[0];
  501. assign PIN_78_out_en = gpio1_io_out_en[0];
  502. assign PIN_82_out_data = gpio1_io_out_data[1];
  503. assign PIN_82_out_en = gpio1_io_out_en[1];
  504. assign PIN_87_out_data = gpio1_io_out_data[2];
  505. assign PIN_87_out_en = gpio1_io_out_en[2];
  506. assign PIN_91_out_data = gpio1_io_out_data[3];
  507. assign PIN_91_out_en = gpio1_io_out_en[3];
  508. assign PIN_80_out_data = gpio1_io_out_data[4];
  509. assign PIN_80_out_en = gpio1_io_out_en[4];
  510. assign PIN_84_out_data = gpio1_io_out_data[5];
  511. assign PIN_84_out_en = gpio1_io_out_en[5];
  512. assign PIN_89_out_data = gpio1_io_out_data[6];
  513. assign PIN_89_out_en = gpio1_io_out_en[6];
  514. assign PIN_93_out_data = gpio1_io_out_data[7];
  515. assign PIN_93_out_en = gpio1_io_out_en[7];
  516. wire [7:0] gpio1_io_in = {1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0};
  517. (* keep = 1 *) wire [7:0] gpio2_io_out_data;
  518. (* keep = 1 *) wire [7:0] gpio2_io_out_en;
  519. assign PIN_29_out_data = gpio2_io_out_data[0];
  520. assign PIN_29_out_en = gpio2_io_out_en[0];
  521. assign PIN_23_out_data = gpio2_io_out_data[1];
  522. assign PIN_23_out_en = gpio2_io_out_en[1];
  523. assign PIN_15_out_data = gpio2_io_out_data[2];
  524. assign PIN_15_out_en = gpio2_io_out_en[2];
  525. assign PIN_3_out_data = gpio2_io_out_data[3];
  526. assign PIN_3_out_en = gpio2_io_out_en[3];
  527. assign PIN_31_out_data = gpio2_io_out_data[4];
  528. assign PIN_31_out_en = gpio2_io_out_en[4];
  529. assign PIN_25_out_data = gpio2_io_out_data[5];
  530. assign PIN_25_out_en = gpio2_io_out_en[5];
  531. assign PIN_17_out_data = gpio2_io_out_data[6];
  532. assign PIN_17_out_en = gpio2_io_out_en[6];
  533. assign PIN_5_out_data = gpio2_io_out_data[7];
  534. assign PIN_5_out_en = gpio2_io_out_en[7];
  535. wire [7:0] gpio2_io_in = {1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0};
  536. wire [7:0] gpio3_io_out_data;
  537. wire [7:0] gpio3_io_out_en;
  538. (* keep = 1 *) wire [7:0] gpio3_io_in = {1'b0, 1'b0, 1'b0, PIN_32_in, PIN_33_in, PIN_35_in, PIN_97_in, PIN_95_in};
  539. wire [7:0] gpio4_io_out_data;
  540. wire [7:0] gpio4_io_out_en;
  541. (* keep = 1 *) wire [7:0] gpio4_io_in = {1'b0, 1'b0, gpio_int_g0_in__5__, gpio_int_g0_in__4__, gpio_int_g0_in__3__, gpio_int_g0_in__2__, gpio_int_g0_in__1__, gpio_int_g0_in__0__};
  542. wire [7:0] gpio5_io_out_data;
  543. wire [7:0] gpio5_io_out_en;
  544. (* keep = 1 *) wire [7:0] gpio5_io_in = {1'b0, 1'b0, gpio_int_g1_in__5__, gpio_int_g1_in__4__, gpio_int_g1_in__3__, gpio_int_g1_in__2__, gpio_int_g1_in__1__, gpio_int_g1_in__0__};
  545. (* keep = 1 *) wire [7:0] gpio6_io_out_data;
  546. (* keep = 1 *) wire [7:0] gpio6_io_out_en;
  547. assign PIN_51_out_data = gpio6_io_out_data[0];
  548. assign PIN_51_out_en = gpio6_io_out_en[0];
  549. assign PIN_52_out_data = gpio6_io_out_data[2];
  550. assign PIN_52_out_en = gpio6_io_out_en[2];
  551. assign PIN_1_out_data = gpio6_io_out_data[4];
  552. assign PIN_1_out_en = gpio6_io_out_en[4];
  553. assign PIN_98_out_data = gpio6_io_out_data[6];
  554. assign PIN_98_out_en = gpio6_io_out_en[6];
  555. (* keep = 1 *) wire [7:0] gpio6_io_in = {rxd_14_ip_in, PIN_98_in, rxd_13_ip_in, 1'b0, rxd_12_ip_in, 1'b0, rxd_15_ip_in, 1'b0};
  556. (* keep = 1 *) wire [7:0] gpio7_io_out_data;
  557. (* keep = 1 *) wire [7:0] gpio7_io_out_en;
  558. assign txd_15_ip_out_data = gpio7_io_out_data[6];
  559. assign txd_15_ip_out_en = gpio7_io_out_en[6];
  560. (* keep = 1 *) wire [7:0] gpio7_io_in = {1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, PIN_38_in, 1'b0};
  561. (* keep = 1 *) wire [7:0] gpio8_io_out_data;
  562. (* keep = 1 *) wire [7:0] gpio8_io_out_en;
  563. assign txd_12_ip_out_data = gpio8_io_out_data[0];
  564. assign txd_12_ip_out_en = gpio8_io_out_en[0];
  565. assign txen_12_ip_out_data = gpio8_io_out_data[1];
  566. assign txen_12_ip_out_en = gpio8_io_out_en[1];
  567. assign txd_13_ip_out_data = gpio8_io_out_data[2];
  568. assign txd_13_ip_out_en = gpio8_io_out_en[2];
  569. assign txen_13_ip_out_data = gpio8_io_out_data[3];
  570. assign txen_13_ip_out_en = gpio8_io_out_en[3];
  571. assign txd_14_ip_out_data = gpio8_io_out_data[4];
  572. assign txd_14_ip_out_en = gpio8_io_out_en[4];
  573. assign txen_14_ip_out_data = gpio8_io_out_data[5];
  574. assign txen_14_ip_out_en = gpio8_io_out_en[5];
  575. assign PIN_36_out_data = gpio8_io_out_data[6];
  576. assign PIN_36_out_en = gpio8_io_out_en[6];
  577. assign txen_15_ip_out_data = gpio8_io_out_data[7];
  578. assign txen_15_ip_out_en = gpio8_io_out_en[7];
  579. wire [7:0] gpio8_io_in = {1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0};
  580. (* keep = 1 *) wire [7:0] gpio9_io_out_data;
  581. (* keep = 1 *) wire [7:0] gpio9_io_out_en;
  582. assign PIN_47_out_data = gpio9_io_out_data[0];
  583. assign PIN_47_out_en = gpio9_io_out_en[0];
  584. assign PIN_48_out_data = gpio9_io_out_data[1];
  585. assign PIN_48_out_en = gpio9_io_out_en[1];
  586. assign PIN_46_out_data = gpio9_io_out_data[2];
  587. assign PIN_46_out_en = gpio9_io_out_en[2];
  588. assign PIN_96_out_data = gpio9_io_out_data[3];
  589. assign PIN_96_out_en = gpio9_io_out_en[3];
  590. assign PIN_39_out_data = gpio9_io_out_data[4];
  591. assign PIN_39_out_en = gpio9_io_out_en[4];
  592. assign PIN_34_out_data = gpio9_io_out_data[5];
  593. assign PIN_34_out_en = gpio9_io_out_en[5];
  594. assign PIN_71_out_data = gpio9_io_out_data[6];
  595. assign PIN_71_out_en = gpio9_io_out_en[6];
  596. assign PIN_70_out_data = gpio9_io_out_data[7];
  597. assign PIN_70_out_en = gpio9_io_out_en[7];
  598. (* keep = 1 *) wire [7:0] gpio9_io_in = {1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, PIN_48_in, 1'b0};
  599. alta_rv32 rv32(
  600. .sys_clk (sys_clk ),
  601. .sys_ctrl_stop (sys_ctrl_stop ),
  602. .sys_ctrl_clkSource (sys_ctrl_clkSource ),
  603. .resetn_out (sys_resetn ),
  604. .sys_ctrl_pllEnable (PLL_ENABLE ),
  605. .sys_ctrl_pllReady (PLL_LOCK ),
  606. .ext_resetn (1'b1 ),
  607. .test_mode (2'b0 ),
  608. .usb0_xcvr_clk (usb0_xcvr_clk ),
  609. .usb0_id (1'b1 ),
  610. .sys_ctrl_hseEnable ( ),
  611. .sys_ctrl_hseBypass ( ),
  612. .sys_ctrl_sleep ( ),
  613. .sys_ctrl_standby ( ),
  614. .dmactive ( ),
  615. .swj_JTAGNSW ( ),
  616. .swj_JTAGSTATE ( ),
  617. .swj_JTAGIR ( ),
  618. .ext_int ({1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0, 1'b0}),
  619. .mem_ahb_htrans (mem_ahb_htrans ),
  620. .mem_ahb_hready (mem_ahb_hready ),
  621. .mem_ahb_hwrite (mem_ahb_hwrite ),
  622. .mem_ahb_haddr (mem_ahb_haddr ),
  623. .mem_ahb_hsize (mem_ahb_hsize ),
  624. .mem_ahb_hburst (mem_ahb_hburst ),
  625. .mem_ahb_hwdata (mem_ahb_hwdata ),
  626. .mem_ahb_hreadyout (mem_ahb_hreadyout ),
  627. .mem_ahb_hresp (mem_ahb_hresp ),
  628. .mem_ahb_hrdata (mem_ahb_hrdata ),
  629. .slave_ahb_hsel (slave_ahb_hsel ),
  630. .slave_ahb_hready (slave_ahb_hready ),
  631. .slave_ahb_hreadyout(slave_ahb_hreadyout ),
  632. .slave_ahb_htrans (slave_ahb_htrans ),
  633. .slave_ahb_hsize (slave_ahb_hsize ),
  634. .slave_ahb_hburst (slave_ahb_hburst ),
  635. .slave_ahb_hwrite (slave_ahb_hwrite ),
  636. .slave_ahb_haddr (slave_ahb_haddr ),
  637. .slave_ahb_hwdata (slave_ahb_hwdata ),
  638. .slave_ahb_hresp (slave_ahb_hresp ),
  639. .slave_ahb_hrdata (slave_ahb_hrdata ),
  640. .ext_dma_DMACBREQ (ext_dma_DMACBREQ ),
  641. .ext_dma_DMACLBREQ (ext_dma_DMACLBREQ ),
  642. .ext_dma_DMACSREQ (ext_dma_DMACSREQ ),
  643. .ext_dma_DMACLSREQ (ext_dma_DMACLSREQ ),
  644. .ext_dma_DMACCLR (ext_dma_DMACCLR ),
  645. .ext_dma_DMACTC (ext_dma_DMACTC ),
  646. .local_int (local_int ),
  647. .gpio0_io_in (gpio0_io_in ),
  648. .gpio0_io_out_data (gpio0_io_out_data ),
  649. .gpio0_io_out_en (gpio0_io_out_en ),
  650. .gpio1_io_in (gpio1_io_in ),
  651. .gpio1_io_out_data (gpio1_io_out_data ),
  652. .gpio1_io_out_en (gpio1_io_out_en ),
  653. .gpio2_io_in (gpio2_io_in ),
  654. .gpio2_io_out_data (gpio2_io_out_data ),
  655. .gpio2_io_out_en (gpio2_io_out_en ),
  656. .gpio3_io_in (gpio3_io_in ),
  657. .gpio3_io_out_data (gpio3_io_out_data ),
  658. .gpio3_io_out_en (gpio3_io_out_en ),
  659. .gpio4_io_in (gpio4_io_in ),
  660. .gpio4_io_out_data (gpio4_io_out_data ),
  661. .gpio4_io_out_en (gpio4_io_out_en ),
  662. .gpio5_io_in (gpio5_io_in ),
  663. .gpio5_io_out_data (gpio5_io_out_data ),
  664. .gpio5_io_out_en (gpio5_io_out_en ),
  665. .gpio6_io_in (gpio6_io_in ),
  666. .gpio6_io_out_data (gpio6_io_out_data ),
  667. .gpio6_io_out_en (gpio6_io_out_en ),
  668. .gpio7_io_in (gpio7_io_in ),
  669. .gpio7_io_out_data (gpio7_io_out_data ),
  670. .gpio7_io_out_en (gpio7_io_out_en ),
  671. .gpio8_io_in (gpio8_io_in ),
  672. .gpio8_io_out_data (gpio8_io_out_data ),
  673. .gpio8_io_out_en (gpio8_io_out_en ),
  674. .gpio9_io_in (gpio9_io_in ),
  675. .gpio9_io_out_data (gpio9_io_out_data ),
  676. .gpio9_io_out_en (gpio9_io_out_en )
  677. );
  678. endmodule