Projektdaten für das ESY1B Praktikum im Sommersemester 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

spi_interface.v 40KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943
  1. /*******************************************************************************
  2. Verilog netlist generated by IPGEN Lattice Radiant Software (64-bit)
  3. 3.1.1.232.1
  4. Soft IP Version: 1.0.0
  5. 2022 05 31 12:27:15
  6. *******************************************************************************/
  7. /*******************************************************************************
  8. Wrapper Module generated per user settings.
  9. *******************************************************************************/
  10. module spi_interface (spi1_miso_io,
  11. spi1_mosi_io,
  12. spi1_sck_io,
  13. spi1_scs_n_i,
  14. spi1_mcs_n_o,
  15. rst_i,
  16. ipload_i,
  17. ipdone_o,
  18. sb_clk_i,
  19. sb_wr_i,
  20. sb_stb_i,
  21. sb_adr_i,
  22. sb_dat_i,
  23. sb_dat_o,
  24. sb_ack_o,
  25. spi_pirq_o,
  26. spi_pwkup_o) ;
  27. inout spi1_miso_io ;
  28. inout spi1_mosi_io ;
  29. inout spi1_sck_io ;
  30. input spi1_scs_n_i ;
  31. output [3:0] spi1_mcs_n_o ;
  32. input rst_i ;
  33. input ipload_i ;
  34. output ipdone_o ;
  35. input sb_clk_i ;
  36. input sb_wr_i ;
  37. input sb_stb_i ;
  38. input [7:0] sb_adr_i ;
  39. input [7:0] sb_dat_i ;
  40. output [7:0] sb_dat_o ;
  41. output sb_ack_o ;
  42. output [1:0] spi_pirq_o ;
  43. output [1:0] spi_pwkup_o ;
  44. spi_interface_ipgen_lscc_spi_i2c #(.i2c_left_enable(0),
  45. .i2c_right_enable(0),
  46. .spi_left_enable(0),
  47. .spi_right_enable(1),
  48. .FREQUENCY_PIN_SBCLKI("12.0"),
  49. .I2C_LEFT_CLK_PRESCALE("29"),
  50. .I2C_LEFT_CLK_DIVIDER(120),
  51. .I2C_LEFT_SLAVE_INIT_ADDR("0b1111101"),
  52. .I2C_LEFT_SDA_INPUT_DELAYED("1"),
  53. .I2C_LEFT_SDA_OUTPUT_DELAYED("0"),
  54. .I2C_LEFT_INIT_VALUE_0(128),
  55. .I2C_LEFT_INIT_VALUE_1(31),
  56. .I2C_LEFT_INIT_VALUE_2(0),
  57. .I2C_RIGHT_CLK_PRESCALE("29"),
  58. .I2C_RIGHT_CLK_DIVIDER(120),
  59. .I2C_RIGHT_SLAVE_INIT_ADDR("0b1111110"),
  60. .I2C_RIGHT_SDA_INPUT_DELAYED("1"),
  61. .I2C_RIGHT_SDA_OUTPUT_DELAYED("0"),
  62. .I2C_RIGHT_INIT_VALUE_5(128),
  63. .I2C_RIGHT_INIT_VALUE_6(31),
  64. .I2C_RIGHT_INIT_VALUE_7(0),
  65. .SPI_LEFT_CLK_DIVIDER(1),
  66. .SPI_LEFT_CLK_PRESCALE("0"),
  67. .SPI_LEFT_MASTER_CHIP_SELECTS(1),
  68. .SPI_LEFT_WAKEUP_ENABLE(1),
  69. .SPI_LEFT_INIT_VALUE_10(8),
  70. .SPI_LEFT_INIT_VALUE_13(0),
  71. .SPI_RIGHT_CLK_DIVIDER(1),
  72. .SPI_RIGHT_CLK_PRESCALE("0"),
  73. .SPI_RIGHT_MASTER_CHIP_SELECTS(3),
  74. .SPI_RIGHT_WAKEUP_ENABLE(0),
  75. .SPI_RIGHT_INIT_VALUE_15(12),
  76. .SPI_RIGHT_INIT_VALUE_18(128)) lscc_spi_i2c_inst (.i2c2_scl_io(),
  77. .i2c2_sda_io(),
  78. .i2c1_scl_io(),
  79. .i2c1_sda_io(),
  80. .spi2_miso_io(),
  81. .spi2_mosi_io(),
  82. .spi2_sck_io(),
  83. .spi2_scs_n_i(1'b0),
  84. .spi2_mcs_n_o(),
  85. .spi1_miso_io(spi1_miso_io),
  86. .spi1_mosi_io(spi1_mosi_io),
  87. .spi1_sck_io(spi1_sck_io),
  88. .spi1_scs_n_i(spi1_scs_n_i),
  89. .spi1_mcs_n_o(spi1_mcs_n_o[3:0]),
  90. .rst_i(rst_i),
  91. .ipload_i(ipload_i),
  92. .ipdone_o(ipdone_o),
  93. .sb_clk_i(sb_clk_i),
  94. .sb_wr_i(sb_wr_i),
  95. .sb_stb_i(sb_stb_i),
  96. .sb_adr_i(sb_adr_i[7:0]),
  97. .sb_dat_i(sb_dat_i[7:0]),
  98. .sb_dat_o(sb_dat_o[7:0]),
  99. .sb_ack_o(sb_ack_o),
  100. .i2c_pirq_o(),
  101. .i2c_pwkup_o(),
  102. .spi_pirq_o(spi_pirq_o[1:0]),
  103. .spi_pwkup_o(spi_pwkup_o[1:0])) ;
  104. endmodule
  105. `timescale 1ns/1ns
  106. // =============================================================================
  107. // >>>>>>>>>>>>>>>>>>>>>>>>> COPYRIGHT NOTICE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
  108. // -----------------------------------------------------------------------------
  109. // Copyright (c) 2017 by Lattice Semiconductor Corporation
  110. // ALL RIGHTS RESERVED
  111. // -----------------------------------------------------------------------------
  112. //
  113. // Permission:
  114. //
  115. // Lattice SG Pte. Ltd. grants permission to use this code
  116. // pursuant to the terms of the Lattice Reference Design License Agreement.
  117. //
  118. //
  119. // Disclaimer:
  120. //
  121. // This VHDL or Verilog source code is intended as a design reference
  122. // which illustrates how these types of functions can be implemented.
  123. // It is the user's responsibility to verify their design for
  124. // consistency and functionality through the use of formal
  125. // verification methods. Lattice provides no warranty
  126. // regarding the use or functionality of this code.
  127. //
  128. // -----------------------------------------------------------------------------
  129. //
  130. // Lattice SG Pte. Ltd.
  131. // 101 Thomson Road, United Square #07-02
  132. // Singapore 307591
  133. //
  134. //
  135. // TEL: 1-800-Lattice (USA and Canada)
  136. // +65-6631-2000 (Singapore)
  137. // +1-503-268-8001 (other locations)
  138. //
  139. // web: http://www.latticesemi.com/
  140. // email: techsupport@latticesemi.com
  141. //
  142. // -----------------------------------------------------------------------------
  143. //
  144. // =============================================================================
  145. // FILE DETAILS
  146. // Project :
  147. // File : lscc_spi_i2c.v
  148. // Title :
  149. // Dependencies : I2C_B primitive
  150. // : SPI_B primitive
  151. // Description :
  152. // =============================================================================
  153. // REVISION HISTORY
  154. // Version : 1.0.0.
  155. // Author(s) :
  156. // Mod. Date :
  157. // Changes Made : Initial release.
  158. // =============================================================================
  159. module spi_interface_ipgen_lscc_spi_i2c #(parameter num_regs = 23,
  160. parameter i2c_left_enable = 0,
  161. parameter i2c_right_enable = 0,
  162. parameter spi_left_enable = 0,
  163. parameter spi_right_enable = 0,
  164. parameter FREQUENCY_PIN_SBCLKI = "NONE",
  165. parameter I2C_LEFT_CLK_DIVIDER = 8,
  166. parameter I2C_LEFT_CLK_PRESCALE = "1",
  167. parameter I2C_LEFT_INIT_VALUE_0 = 0,
  168. parameter I2C_LEFT_INIT_VALUE_1 = 0,
  169. parameter I2C_LEFT_INIT_VALUE_2 = 0,
  170. parameter I2C_LEFT_SLAVE_INIT_ADDR = "0b1111100001",
  171. parameter I2C_LEFT_SDA_INPUT_DELAYED = "1",
  172. parameter I2C_LEFT_SDA_OUTPUT_DELAYED = "0",
  173. parameter I2C_RIGHT_CLK_DIVIDER = 8,
  174. parameter I2C_RIGHT_CLK_PRESCALE = "1",
  175. parameter I2C_RIGHT_INIT_VALUE_5 = 0,
  176. parameter I2C_RIGHT_INIT_VALUE_6 = 0,
  177. parameter I2C_RIGHT_INIT_VALUE_7 = 0,
  178. parameter I2C_RIGHT_SLAVE_INIT_ADDR = "0b1111100010",
  179. parameter I2C_RIGHT_SDA_INPUT_DELAYED = "1",
  180. parameter I2C_RIGHT_SDA_OUTPUT_DELAYED = "0",
  181. parameter SPI_LEFT_INIT_VALUE_10 = 0,
  182. parameter SPI_LEFT_INIT_VALUE_13 = 0,
  183. parameter SPI_RIGHT_INIT_VALUE_15 = 0,
  184. parameter SPI_RIGHT_INIT_VALUE_18 = 0,
  185. parameter SPI_LEFT_WAKEUP_ENABLE = 1,
  186. parameter SPI_LEFT_CLK_DIVIDER = 2,
  187. parameter SPI_LEFT_CLK_PRESCALE = "1",
  188. parameter SPI_LEFT_MASTER_CHIP_SELECTS = 1,
  189. parameter SPI_RIGHT_WAKEUP_ENABLE = 1,
  190. parameter SPI_RIGHT_CLK_DIVIDER = 2,
  191. parameter SPI_RIGHT_CLK_PRESCALE = "1",
  192. parameter SPI_RIGHT_MASTER_CHIP_SELECTS = 1) (
  193. // -----------------------------------------------------------------------------
  194. // Module Parameters
  195. // -----------------------------------------------------------------------------
  196. // (I2C_LEFT_CLK_PRESCALE+1) * 4
  197. // (1 - 1023)
  198. // (I2C_RIGHT_CLK_PRESCALE+1) * 4
  199. // (1 - 1023)
  200. // SPI_LEFT_CLK_PRESCALE + 1
  201. // (1 - 63)
  202. // SPI_RIGHT_CLK_PRESCALE + 1
  203. // (1 - 63)
  204. // -----------------------------------------------------------------------------
  205. // Input/Output Ports
  206. // -----------------------------------------------------------------------------
  207. // I2C Left
  208. inout wire i2c2_scl_io,
  209. inout wire i2c2_sda_io,
  210. // I2c Right
  211. inout wire i2c1_scl_io,
  212. inout wire i2c1_sda_io,
  213. // SPI Left
  214. inout wire spi2_miso_io,
  215. inout wire spi2_mosi_io,
  216. inout wire spi2_sck_io,
  217. input wire spi2_scs_n_i,
  218. output wire [3:0] spi2_mcs_n_o,
  219. // SPI Right
  220. inout wire spi1_miso_io,
  221. inout wire spi1_mosi_io,
  222. inout wire spi1_sck_io,
  223. input wire spi1_scs_n_i,
  224. output wire [3:0] spi1_mcs_n_o,
  225. // Fabric Interface
  226. input wire rst_i,
  227. input wire ipload_i,
  228. output wire ipdone_o,
  229. input wire sb_clk_i,
  230. input wire sb_wr_i,
  231. input wire sb_stb_i,
  232. input wire [7:0] sb_adr_i,
  233. input wire [7:0] sb_dat_i,
  234. output wire [7:0] sb_dat_o,
  235. output wire sb_ack_o,
  236. output wire [1:0] i2c_pirq_o,
  237. output wire [1:0] i2c_pwkup_o,
  238. output wire [1:0] spi_pirq_o,
  239. output wire [1:0] spi_pwkup_o) ;
  240. // -----------------------------------------------------------------------------
  241. // Local Parameters
  242. // -----------------------------------------------------------------------------
  243. localparam RSVD = 8'hFF ;
  244. // I2C Base Address
  245. localparam I2CBADDRL = 4'b0001 ; // I2C LEFT
  246. localparam I2CBADDRR = 4'b0011 ; // I2C RIGHT
  247. // I2C Register Address
  248. localparam I2CCR1 = 4'b1000 ; // I2C Control Register 1
  249. localparam I2CCMDR = 4'b1001 ; // I2C Command Register
  250. localparam I2CBRLSB = 4'b1010 ; // I2C Clock Presale register, LSB
  251. localparam I2CBRMSB = 4'b1011 ; // I2C Clock Presale register, MSB
  252. localparam I2CSR = 4'b1100 ; // I2C Status Register
  253. localparam I2CTXDR = 4'b1101 ; // I2C Transmitting Data Register
  254. localparam I2CRXDR = 4'b1110 ; // I2C Receiving Data Register
  255. localparam I2CGCDR = 4'b1111 ; // I2C General Call Information Register
  256. localparam I2CINTCR = 4'b0111 ; // I2C Interrupt Control Register
  257. localparam I2CINTSR = 4'b0110 ; // I2C Interrupt Status Register
  258. localparam I2CSADDR = 4'b0011 ; // I2C Slave address MSB
  259. // SPI Base Address
  260. localparam SPIBADDRL = 4'b0000 ; // SPI LEFT
  261. localparam SPIBADDRR = 4'b0010 ; // SPI RIGHT
  262. // SPI Register Address
  263. localparam SPICR0 = 4'b1000 ; // SPI Control Register0
  264. localparam SPICR1 = 4'b1001 ; // SPI Control Register1
  265. localparam SPICR2 = 4'b1010 ; // SPI Control Register2
  266. localparam SPIBR = 4'b1011 ; // SPI Baud Rate Register
  267. localparam SPISR = 4'b1100 ; // SPI Status Register
  268. localparam SPITXDR = 4'b1101 ; // SPI Transmitting Data Register
  269. localparam SPIRXDR = 4'b1110 ; // SPI Receiving Data Register
  270. localparam SPICSR = 4'b1111 ; // SPI Chip Select Mask for Master Mode
  271. localparam SPIINTCR = 4'b0111 ; // SPI Interrupt Control Register
  272. localparam SPIINTSR = 4'b0110 ; // SPI Interrupt Status Register
  273. // -----------------------------------------------------------------------------
  274. // Combinatorial/Sequential Registers
  275. // -----------------------------------------------------------------------------
  276. reg [7:0] SBDATo_i ;
  277. reg load_d1 ;
  278. reg load_d2 ;
  279. reg start ;
  280. reg pup ;
  281. reg run ;
  282. reg [5:0] trans_count ;
  283. reg IPDONE_i ;
  284. reg sb_idle ;
  285. reg strobe ;
  286. reg wb_we_ix ;
  287. reg wb_stb_ix ;
  288. reg [7:0] wb_adr_ix ;
  289. reg [7:0] wb_dat_ix ;
  290. reg [5:0] start_count ;
  291. reg [5:0] next_count ;
  292. // -----------------------------------------------------------------------------
  293. // Wire Declarations
  294. // -----------------------------------------------------------------------------
  295. wire hard_SBWRi ;
  296. wire hard_SBSTBi ;
  297. wire [7:0] hard_SBADRi ;
  298. wire [7:0] hard_SBDATi ;
  299. wire hard00_SBACKO ;
  300. wire hard01_SBACKO ;
  301. wire hard10_SBACKO ;
  302. wire hard11_SBACKO ;
  303. wire [3:0] hard_ACKs ;
  304. wire SBACKo_i ;
  305. wire [7:0] hard00_SBDATo ;
  306. wire [7:0] hard01_SBDATo ;
  307. wire [7:0] hard10_SBDATo ;
  308. wire [7:0] hard11_SBDATo ;
  309. wire ssm_SBWRi ;
  310. wire ssm_SBSTBi ;
  311. wire [7:0] ssm_SBADRi ;
  312. wire [7:0] ssm_SBDATi ;
  313. wire I2C2_SCLo ;
  314. wire I2C2_SCLoe ;
  315. wire I2C2_SCLi ;
  316. wire I2C2_SDAo ;
  317. wire I2C2_SDAoe ;
  318. wire I2C2_SDAi ;
  319. wire I2C1_SCLo ;
  320. wire I2C1_SCLoe ;
  321. wire I2C1_SCLi ;
  322. wire I2C1_SDAo ;
  323. wire I2C1_SDAoe ;
  324. wire I2C1_SDAi ;
  325. wire SPI2_SO ;
  326. wire SPI2_SOoe ;
  327. wire SPI2_MI ;
  328. wire SPI2_MO ;
  329. wire SPI2_MOoe ;
  330. wire SPI2_SI ;
  331. wire SPI2_SCKo ;
  332. wire SPI2_SCKoe ;
  333. wire SPI2_SCKi ;
  334. wire SPI2_SCSNi ;
  335. wire [3:0] SPI2_MCSNo ;
  336. wire [3:0] SPI2_MCSNoe ;
  337. wire SPI1_SO ;
  338. wire SPI1_SOoe ;
  339. wire SPI1_MI ;
  340. wire SPI1_MO ;
  341. wire SPI1_MOoe ;
  342. wire SPI1_SI ;
  343. wire SPI1_SCKo ;
  344. wire SPI1_SCKoe ;
  345. wire SPI1_SCKi ;
  346. wire SPI1_SCSNi ;
  347. wire [3:0] SPI1_MCSNo ;
  348. wire [3:0] SPI1_MCSNoe ;
  349. wire [7:0] init_value [0:(num_regs - 1)] ;
  350. wire [7:0] init_addr [0:(num_regs - 1)] ;
  351. wire [11:0] i2c_left_prescale ;
  352. wire [11:0] i2c_right_prescale ;
  353. // -----------------------------------------------------------------------------
  354. // Assign Statements
  355. // -----------------------------------------------------------------------------
  356. assign i2c_left_prescale = ((I2C_LEFT_CLK_DIVIDER > 4) ? (I2C_LEFT_CLK_DIVIDER - 4) : 0) ;
  357. assign i2c_right_prescale = ((I2C_RIGHT_CLK_DIVIDER > 4) ? (I2C_RIGHT_CLK_DIVIDER - 4) : 0) ;
  358. assign init_value[0] = I2C_LEFT_INIT_VALUE_0 ;
  359. assign init_value[1] = I2C_LEFT_INIT_VALUE_1 ;
  360. assign init_value[2] = I2C_LEFT_INIT_VALUE_2 ;
  361. assign init_value[3] = i2c_left_prescale[9:2] ;
  362. assign init_value[4] = {6'd0,
  363. i2c_left_prescale[11:10]} ;
  364. assign init_value[5] = I2C_RIGHT_INIT_VALUE_5 ;
  365. assign init_value[6] = I2C_RIGHT_INIT_VALUE_6 ;
  366. assign init_value[7] = I2C_RIGHT_INIT_VALUE_7 ;
  367. assign init_value[8] = i2c_right_prescale[9:2] ;
  368. assign init_value[9] = {6'd0,
  369. i2c_right_prescale[11:10]} ;
  370. assign init_value[10] = {3'd0,
  371. SPI_LEFT_INIT_VALUE_10[3:0],
  372. 1'b0} ;
  373. assign init_value[11] = {4'd0,
  374. SPI_LEFT_MASTER_CHIP_SELECTS[3:0]} ;
  375. assign init_value[12] = {1'b1,
  376. SPI_LEFT_WAKEUP_ENABLE[0],
  377. 6'd0} ;
  378. assign init_value[13] = (SPI_LEFT_INIT_VALUE_13 & 8'hA7) ; // 8'hA7 - masks reserved bits
  379. assign init_value[14] = (SPI_LEFT_CLK_DIVIDER - 1) ;
  380. assign init_value[15] = {3'd0,
  381. SPI_RIGHT_INIT_VALUE_15[3:0],
  382. 1'b0} ;
  383. assign init_value[16] = {4'd0,
  384. SPI_RIGHT_MASTER_CHIP_SELECTS[3:0]} ;
  385. assign init_value[17] = {1'b1,
  386. SPI_RIGHT_WAKEUP_ENABLE[0],
  387. 6'd0} ;
  388. assign init_value[18] = (SPI_RIGHT_INIT_VALUE_18 & 8'hA7) ; // 8'hA7 - masks reserved bits
  389. assign init_value[19] = (SPI_RIGHT_CLK_DIVIDER - 1) ;
  390. assign init_value[20] = RSVD ;
  391. assign init_value[21] = RSVD ;
  392. assign init_value[22] = RSVD ;
  393. assign init_addr[20] = RSVD ;
  394. assign init_addr[21] = RSVD ;
  395. assign init_addr[22] = RSVD ;
  396. // SYSTEM BUS multiplexing
  397. assign hard_SBWRi = (IPDONE_i ? sb_wr_i : ssm_SBWRi) ;
  398. assign hard_SBSTBi = (IPDONE_i ? sb_stb_i : ssm_SBSTBi) ;
  399. assign hard_SBADRi = (IPDONE_i ? sb_adr_i : ssm_SBADRi) ;
  400. assign hard_SBDATi = (IPDONE_i ? sb_dat_i : ssm_SBDATi) ;
  401. // {i2c_right, spi_righ, i2c_left, spi_left}
  402. assign hard_ACKs = {hard11_SBACKO,
  403. hard10_SBACKO,
  404. hard01_SBACKO,
  405. hard00_SBACKO} ;
  406. assign SBACKo_i = (|hard_ACKs) ;
  407. // Initialization SSM outputs
  408. assign ssm_SBWRi = 1 ; // All transaction are WRITE
  409. assign ssm_SBSTBi = strobe ;
  410. assign ssm_SBADRi = init_addr[trans_count] ;
  411. assign ssm_SBDATi = init_value[trans_count] ;
  412. assign sb_dat_o = SBDATo_i ;
  413. assign sb_ack_o = (SBACKo_i && IPDONE_i) ;
  414. assign ipdone_o = IPDONE_i ;
  415. // -----------------------------------------------------------------------------
  416. // Generate Assign Statements
  417. // -----------------------------------------------------------------------------
  418. generate
  419. if ((i2c_left_enable == 1))
  420. begin : genblk1
  421. assign init_addr[0] = {I2CBADDRL,
  422. I2CCR1} ;
  423. assign init_addr[1] = {I2CBADDRL,
  424. I2CSADDR} ;
  425. assign init_addr[2] = {I2CBADDRL,
  426. I2CINTCR} ;
  427. assign init_addr[3] = {I2CBADDRL,
  428. I2CBRLSB} ;
  429. assign init_addr[4] = {I2CBADDRL,
  430. I2CBRMSB} ;
  431. end
  432. else
  433. begin : genblk1
  434. assign init_addr[0] = RSVD ;
  435. assign init_addr[1] = RSVD ;
  436. assign init_addr[2] = RSVD ;
  437. assign init_addr[3] = RSVD ;
  438. assign init_addr[4] = RSVD ;
  439. end
  440. if ((i2c_right_enable == 1))
  441. begin : genblk2
  442. assign init_addr[5] = {I2CBADDRR,
  443. I2CCR1} ;
  444. assign init_addr[6] = {I2CBADDRR,
  445. I2CSADDR} ;
  446. assign init_addr[7] = {I2CBADDRR,
  447. I2CINTCR} ;
  448. assign init_addr[8] = {I2CBADDRR,
  449. I2CBRLSB} ;
  450. assign init_addr[9] = {I2CBADDRR,
  451. I2CBRMSB} ;
  452. end
  453. else
  454. begin : genblk2
  455. assign init_addr[5] = RSVD ;
  456. assign init_addr[6] = RSVD ;
  457. assign init_addr[7] = RSVD ;
  458. assign init_addr[8] = RSVD ;
  459. assign init_addr[9] = RSVD ;
  460. end
  461. if ((spi_left_enable == 1))
  462. begin : genblk3
  463. assign init_addr[10] = {SPIBADDRL,
  464. SPIINTCR} ;
  465. assign init_addr[11] = {SPIBADDRL,
  466. SPICSR} ;
  467. assign init_addr[12] = {SPIBADDRL,
  468. SPICR1} ;
  469. assign init_addr[13] = {SPIBADDRL,
  470. SPICR2} ;
  471. assign init_addr[14] = {SPIBADDRL,
  472. SPIBR} ;
  473. end
  474. else
  475. begin : genblk3
  476. assign init_addr[10] = RSVD ;
  477. assign init_addr[11] = RSVD ;
  478. assign init_addr[12] = RSVD ;
  479. assign init_addr[13] = RSVD ;
  480. assign init_addr[14] = RSVD ;
  481. end
  482. if ((spi_right_enable == 1))
  483. begin : genblk4
  484. assign init_addr[15] = {SPIBADDRR,
  485. SPIINTCR} ;
  486. assign init_addr[16] = {SPIBADDRR,
  487. SPICSR} ;
  488. assign init_addr[17] = {SPIBADDRR,
  489. SPICR1} ;
  490. assign init_addr[18] = {SPIBADDRR,
  491. SPICR2} ;
  492. assign init_addr[19] = {SPIBADDRR,
  493. SPIBR} ;
  494. end
  495. else
  496. begin : genblk4
  497. assign init_addr[15] = RSVD ;
  498. assign init_addr[16] = RSVD ;
  499. assign init_addr[17] = RSVD ;
  500. assign init_addr[18] = RSVD ;
  501. assign init_addr[19] = RSVD ;
  502. end
  503. endgenerate
  504. generate
  505. if ((i2c_left_enable == 1))
  506. begin : genblk5
  507. assign i2c2_scl_io = (I2C2_SCLoe ? I2C2_SCLo : 1'bZ) ;
  508. assign i2c2_sda_io = (I2C2_SDAoe ? I2C2_SDAo : 1'bZ) ;
  509. assign I2C2_SCLi = i2c2_scl_io ;
  510. assign I2C2_SDAi = i2c2_sda_io ;
  511. end
  512. if ((i2c_right_enable == 1))
  513. begin : genblk6
  514. assign i2c1_scl_io = (I2C1_SCLoe ? I2C1_SCLo : 1'bZ) ;
  515. assign i2c1_sda_io = (I2C1_SDAoe ? I2C1_SDAo : 1'bZ) ;
  516. assign I2C1_SCLi = i2c1_scl_io ;
  517. assign I2C1_SDAi = i2c1_sda_io ;
  518. end
  519. if ((spi_left_enable == 1))
  520. begin : genblk7
  521. assign spi2_miso_io = (SPI2_SOoe ? SPI2_SO : 1'bZ) ;
  522. assign SPI2_MI = spi2_miso_io ;
  523. assign spi2_mosi_io = (SPI2_MOoe ? SPI2_MO : 1'bZ) ;
  524. assign SPI2_SI = spi2_mosi_io ;
  525. assign spi2_sck_io = (SPI2_SCKoe ? SPI2_SCKo : 1'bZ) ;
  526. assign SPI2_SCKi = spi2_sck_io ;
  527. assign SPI2_SCSNi = spi2_scs_n_i ;
  528. assign spi2_mcs_n_o[3] = (SPI2_MCSNoe[3] ? SPI2_MCSNo[3] : 1'bZ) ;
  529. assign spi2_mcs_n_o[2] = (SPI2_MCSNoe[2] ? SPI2_MCSNo[2] : 1'bZ) ;
  530. assign spi2_mcs_n_o[1] = (SPI2_MCSNoe[1] ? SPI2_MCSNo[1] : 1'bZ) ;
  531. assign spi2_mcs_n_o[0] = (SPI2_MCSNoe[0] ? SPI2_MCSNo[0] : 1'bZ) ;
  532. end
  533. if ((spi_right_enable == 1))
  534. begin : genblk8
  535. assign spi1_miso_io = (SPI1_SOoe ? SPI1_SO : 1'bZ) ;
  536. assign SPI1_MI = spi1_miso_io ;
  537. assign spi1_mosi_io = (SPI1_MOoe ? SPI1_MO : 1'bZ) ;
  538. assign SPI1_SI = spi1_mosi_io ;
  539. assign spi1_sck_io = (SPI1_SCKoe ? SPI1_SCKo : 1'bZ) ;
  540. assign SPI1_SCKi = spi1_sck_io ;
  541. assign SPI1_SCSNi = spi1_scs_n_i ;
  542. assign spi1_mcs_n_o[3] = (SPI1_MCSNoe[3] ? SPI1_MCSNo[3] : 1'bZ) ;
  543. assign spi1_mcs_n_o[2] = (SPI1_MCSNoe[2] ? SPI1_MCSNo[2] : 1'bZ) ;
  544. assign spi1_mcs_n_o[1] = (SPI1_MCSNoe[1] ? SPI1_MCSNo[1] : 1'bZ) ;
  545. assign spi1_mcs_n_o[0] = (SPI1_MCSNoe[0] ? SPI1_MCSNo[0] : 1'bZ) ;
  546. end
  547. endgenerate
  548. // -----------------------------------------------------------------------------
  549. // Combinatorial Blocks
  550. // -----------------------------------------------------------------------------
  551. always
  552. @(*)
  553. begin
  554. wb_we_ix = hard_SBWRi ;
  555. end
  556. always
  557. @(*)
  558. begin
  559. wb_stb_ix = hard_SBSTBi ;
  560. end
  561. always
  562. @(*)
  563. begin
  564. wb_adr_ix = hard_SBADRi ;
  565. end
  566. always
  567. @(*)
  568. begin
  569. wb_dat_ix = hard_SBDATi ;
  570. end
  571. //-----------------------------------------------------------------------------
  572. // DATo mux
  573. //-----------------------------------------------------------------------------
  574. always
  575. @(*)
  576. begin
  577. case (hard_ACKs)
  578. 4'b1000 :
  579. SBDATo_i = hard11_SBDATo ;
  580. 4'b0100 :
  581. SBDATo_i = hard10_SBDATo ;
  582. 4'b0010 :
  583. SBDATo_i = hard01_SBDATo ;
  584. 4'b0001 :
  585. SBDATo_i = hard00_SBDATo ;
  586. default :
  587. SBDATo_i = 8'b0 ;
  588. endcase
  589. end
  590. //-----------------------------------------------------------------------------
  591. // Initialization SSM control: Start, Run, Done
  592. //-----------------------------------------------------------------------------
  593. always
  594. @(posedge sb_clk_i or
  595. posedge rst_i)
  596. begin
  597. if (rst_i)
  598. begin
  599. load_d1 <= 0 ;
  600. load_d2 <= 0 ;
  601. start <= 0 ;
  602. pup <= 1 ;
  603. run <= 0 ;
  604. trans_count <= 0 ;
  605. IPDONE_i <= 0 ;
  606. end
  607. else
  608. begin
  609. load_d1 <= (ipload_i || pup) ;
  610. load_d2 <= load_d1 ;
  611. start <= (load_d1 && (!load_d2)) ;// rising-edge detection
  612. if (start) // clear power-up launch flag
  613. pup <= 0 ;
  614. if (start)
  615. run <= 1 ;
  616. else
  617. // start init sequence
  618. if (IPDONE_i) // clear when init complete
  619. run <= 0 ;
  620. // reset control upon Start
  621. if (start)
  622. begin
  623. trans_count <= start_count ;
  624. IPDONE_i <= 0 ;
  625. end
  626. else
  627. // DONE
  628. if ((init_addr[trans_count] == 8'hFF))
  629. begin
  630. IPDONE_i <= 1 ;
  631. end
  632. else
  633. // increment if not DONE
  634. if (SBACKo_i)
  635. begin
  636. trans_count <= next_count ;
  637. end
  638. end
  639. end
  640. always
  641. @(*)
  642. begin
  643. start_count = (i2c_left_enable ? 6'd0 : (i2c_right_enable ? 6'd5 : (spi_left_enable ? 6'd10 : (spi_right_enable ? 6'd15 : 6'd20)))) ;
  644. next_count = ((((trans_count + 1) < 6'd20) && (init_addr[(trans_count + 1)] != 8'hFF)) ? (trans_count + 1) : ((((trans_count + 6) < 6'd20) && (init_addr[(trans_count + 6)] != 8'hFF)) ? (trans_count + 6) : ((((trans_count + 11) < 6'd20) && (init_addr[(trans_count + 11)] != 8'hFF)) ? (trans_count + 11) : 6'd20))) ;
  645. end//--always @*--
  646. //-----------------------------------------------------------------------------
  647. // System Bus transaction control
  648. // Assert stb until EFB acknowledges with sb_ack_o
  649. //-----------------------------------------------------------------------------
  650. always
  651. @(posedge sb_clk_i or
  652. posedge rst_i)
  653. begin
  654. if (rst_i)
  655. begin
  656. sb_idle <= 1 ;
  657. strobe <= 0 ;
  658. end
  659. else
  660. begin
  661. // Assert stb signals to start SB transaction
  662. if (sb_idle)
  663. begin
  664. if (run)
  665. begin
  666. // delay 1 ns to avoid simulation/hardware mismatch
  667. strobe <= #(1) 1 ;
  668. sb_idle <= 0 ;
  669. end
  670. end
  671. else
  672. // Monitor sb_ack_o for end of transaction
  673. begin
  674. if ((SBACKo_i | (!run)))
  675. begin
  676. strobe <= 0 ;
  677. sb_idle <= 1 ;
  678. end
  679. end
  680. end
  681. end
  682. // -----------------------------------------------------------------------------
  683. // Submodule Instantiations
  684. // -----------------------------------------------------------------------------
  685. generate
  686. if ((i2c_left_enable == 1))
  687. begin : genblk9
  688. I2C_B #(.I2C_SLAVE_INIT_ADDR(I2C_LEFT_SLAVE_INIT_ADDR),
  689. .BUS_ADDR74("0b0001"),
  690. .I2C_CLK_DIVIDER(I2C_LEFT_CLK_PRESCALE),
  691. .FREQUENCY_PIN_SBCLKI(FREQUENCY_PIN_SBCLKI),
  692. .SDA_INPUT_DELAYED(I2C_LEFT_SDA_INPUT_DELAYED),
  693. .SDA_OUTPUT_DELAYED(I2C_LEFT_SDA_OUTPUT_DELAYED)) u_I2C_B_INST_LT (.SBCLKI(sb_clk_i),
  694. .SBRWI(wb_we_ix),
  695. .SBSTBI(wb_stb_ix),
  696. .SBADRI7(wb_adr_ix[7]),
  697. .SBADRI6(wb_adr_ix[6]),
  698. .SBADRI5(wb_adr_ix[5]),
  699. .SBADRI4(wb_adr_ix[4]),
  700. .SBADRI3(wb_adr_ix[3]),
  701. .SBADRI2(wb_adr_ix[2]),
  702. .SBADRI1(wb_adr_ix[1]),
  703. .SBADRI0(wb_adr_ix[0]),
  704. .SBDATI7(wb_dat_ix[7]),
  705. .SBDATI6(wb_dat_ix[6]),
  706. .SBDATI5(wb_dat_ix[5]),
  707. .SBDATI4(wb_dat_ix[4]),
  708. .SBDATI3(wb_dat_ix[3]),
  709. .SBDATI2(wb_dat_ix[2]),
  710. .SBDATI1(wb_dat_ix[1]),
  711. .SBDATI0(wb_dat_ix[0]),
  712. .SCLI(I2C2_SCLi),
  713. .SDAI(I2C2_SDAi),
  714. .SBDATO7(hard01_SBDATo[7]),
  715. .SBDATO6(hard01_SBDATo[6]),
  716. .SBDATO5(hard01_SBDATo[5]),
  717. .SBDATO4(hard01_SBDATo[4]),
  718. .SBDATO3(hard01_SBDATo[3]),
  719. .SBDATO2(hard01_SBDATo[2]),
  720. .SBDATO1(hard01_SBDATo[1]),
  721. .SBDATO0(hard01_SBDATo[0]),
  722. .SBACKO(hard01_SBACKO),
  723. .I2CIRQ(i2c_pirq_o[0]),
  724. .I2CWKUP(i2c_pwkup_o[0]),
  725. .SCLO(I2C2_SCLo),
  726. .SCLOE(I2C2_SCLoe),
  727. .SDAO(I2C2_SDAo),
  728. .SDAOE(I2C2_SDAoe)) ;
  729. end
  730. else
  731. begin : genblk9
  732. assign hard01_SBDATo[7] = 1'b0 ;
  733. assign hard01_SBDATo[6] = 1'b0 ;
  734. assign hard01_SBDATo[5] = 1'b0 ;
  735. assign hard01_SBDATo[4] = 1'b0 ;
  736. assign hard01_SBDATo[3] = 1'b0 ;
  737. assign hard01_SBDATo[2] = 1'b0 ;
  738. assign hard01_SBDATo[1] = 1'b0 ;
  739. assign hard01_SBDATo[0] = 1'b0 ;
  740. assign hard01_SBACKO = 1'b0 ;
  741. assign i2c_pirq_o[0] = 1'b0 ;
  742. assign i2c_pwkup_o[0] = 1'b0 ;
  743. end
  744. if ((i2c_right_enable == 1))
  745. begin : genblk10
  746. I2C_B #(.I2C_SLAVE_INIT_ADDR(I2C_RIGHT_SLAVE_INIT_ADDR),
  747. .BUS_ADDR74("0b0011"),
  748. .I2C_CLK_DIVIDER(I2C_RIGHT_CLK_PRESCALE),
  749. .FREQUENCY_PIN_SBCLKI(FREQUENCY_PIN_SBCLKI),
  750. .SDA_INPUT_DELAYED(I2C_RIGHT_SDA_INPUT_DELAYED),
  751. .SDA_OUTPUT_DELAYED(I2C_RIGHT_SDA_OUTPUT_DELAYED)) u_I2C_B_INST_RT (.SBCLKI(sb_clk_i),
  752. .SBRWI(wb_we_ix),
  753. .SBSTBI(wb_stb_ix),
  754. .SBADRI7(wb_adr_ix[7]),
  755. .SBADRI6(wb_adr_ix[6]),
  756. .SBADRI5(wb_adr_ix[5]),
  757. .SBADRI4(wb_adr_ix[4]),
  758. .SBADRI3(wb_adr_ix[3]),
  759. .SBADRI2(wb_adr_ix[2]),
  760. .SBADRI1(wb_adr_ix[1]),
  761. .SBADRI0(wb_adr_ix[0]),
  762. .SBDATI7(wb_dat_ix[7]),
  763. .SBDATI6(wb_dat_ix[6]),
  764. .SBDATI5(wb_dat_ix[5]),
  765. .SBDATI4(wb_dat_ix[4]),
  766. .SBDATI3(wb_dat_ix[3]),
  767. .SBDATI2(wb_dat_ix[2]),
  768. .SBDATI1(wb_dat_ix[1]),
  769. .SBDATI0(wb_dat_ix[0]),
  770. .SCLI(I2C1_SCLi),
  771. .SDAI(I2C1_SDAi),
  772. .SBDATO7(hard11_SBDATo[7]),
  773. .SBDATO6(hard11_SBDATo[6]),
  774. .SBDATO5(hard11_SBDATo[5]),
  775. .SBDATO4(hard11_SBDATo[4]),
  776. .SBDATO3(hard11_SBDATo[3]),
  777. .SBDATO2(hard11_SBDATo[2]),
  778. .SBDATO1(hard11_SBDATo[1]),
  779. .SBDATO0(hard11_SBDATo[0]),
  780. .SBACKO(hard11_SBACKO),
  781. .I2CIRQ(i2c_pirq_o[1]),
  782. .I2CWKUP(i2c_pwkup_o[1]),
  783. .SCLO(I2C1_SCLo),
  784. .SCLOE(I2C1_SCLoe),
  785. .SDAO(I2C1_SDAo),
  786. .SDAOE(I2C1_SDAoe)) ;
  787. end
  788. else
  789. begin : genblk10
  790. assign hard11_SBDATo[7] = 1'b0 ;
  791. assign hard11_SBDATo[6] = 1'b0 ;
  792. assign hard11_SBDATo[5] = 1'b0 ;
  793. assign hard11_SBDATo[4] = 1'b0 ;
  794. assign hard11_SBDATo[3] = 1'b0 ;
  795. assign hard11_SBDATo[2] = 1'b0 ;
  796. assign hard11_SBDATo[1] = 1'b0 ;
  797. assign hard11_SBDATo[0] = 1'b0 ;
  798. assign hard11_SBACKO = 1'b0 ;
  799. assign i2c_pirq_o[1] = 1'b0 ;
  800. assign i2c_pwkup_o[1] = 1'b0 ;
  801. end
  802. if ((spi_left_enable == 1))
  803. begin : genblk11
  804. SPI_B #(.FREQUENCY_PIN_SBCLKI(FREQUENCY_PIN_SBCLKI),
  805. .SPI_CLK_DIVIDER(SPI_LEFT_CLK_PRESCALE),
  806. .BUS_ADDR74("0b0000")) u_SPI_B_INST_LT (.SBCLKI(sb_clk_i),
  807. .SBRWI(wb_we_ix),
  808. .SBSTBI(wb_stb_ix),
  809. .SBADRI7(wb_adr_ix[7]),
  810. .SBADRI6(wb_adr_ix[6]),
  811. .SBADRI5(wb_adr_ix[5]),
  812. .SBADRI4(wb_adr_ix[4]),
  813. .SBADRI3(wb_adr_ix[3]),
  814. .SBADRI2(wb_adr_ix[2]),
  815. .SBADRI1(wb_adr_ix[1]),
  816. .SBADRI0(wb_adr_ix[0]),
  817. .SBDATI7(wb_dat_ix[7]),
  818. .SBDATI6(wb_dat_ix[6]),
  819. .SBDATI5(wb_dat_ix[5]),
  820. .SBDATI4(wb_dat_ix[4]),
  821. .SBDATI3(wb_dat_ix[3]),
  822. .SBDATI2(wb_dat_ix[2]),
  823. .SBDATI1(wb_dat_ix[1]),
  824. .SBDATI0(wb_dat_ix[0]),
  825. .MI(SPI2_MI),
  826. .SI(SPI2_SI),
  827. .SCKI(SPI2_SCKi),
  828. .SCSNI(SPI2_SCSNi),
  829. .SBDATO7(hard00_SBDATo[7]),
  830. .SBDATO6(hard00_SBDATo[6]),
  831. .SBDATO5(hard00_SBDATo[5]),
  832. .SBDATO4(hard00_SBDATo[4]),
  833. .SBDATO3(hard00_SBDATo[3]),
  834. .SBDATO2(hard00_SBDATo[2]),
  835. .SBDATO1(hard00_SBDATo[1]),
  836. .SBDATO0(hard00_SBDATo[0]),
  837. .SBACKO(hard00_SBACKO),
  838. .SPIIRQ(spi_pirq_o[0]),
  839. .SPIWKUP(spi_pwkup_o[0]),
  840. .SO(SPI2_SO),
  841. .SOE(SPI2_SOoe),
  842. .MO(SPI2_MO),
  843. .MOE(SPI2_MOoe),
  844. .SCKO(SPI2_SCKo),
  845. .SCKOE(SPI2_SCKoe),
  846. .MCSNO3(SPI2_MCSNo[3]),
  847. .MCSNO2(SPI2_MCSNo[2]),
  848. .MCSNO1(SPI2_MCSNo[1]),
  849. .MCSNO0(SPI2_MCSNo[0]),
  850. .MCSNOE3(SPI2_MCSNoe[3]),
  851. .MCSNOE2(SPI2_MCSNoe[2]),
  852. .MCSNOE1(SPI2_MCSNoe[1]),
  853. .MCSNOE0(SPI2_MCSNoe[0])) ;
  854. end
  855. else
  856. begin : genblk11
  857. assign hard00_SBDATo[7] = 1'b0 ;
  858. assign hard00_SBDATo[6] = 1'b0 ;
  859. assign hard00_SBDATo[5] = 1'b0 ;
  860. assign hard00_SBDATo[4] = 1'b0 ;
  861. assign hard00_SBDATo[3] = 1'b0 ;
  862. assign hard00_SBDATo[2] = 1'b0 ;
  863. assign hard00_SBDATo[1] = 1'b0 ;
  864. assign hard00_SBDATo[0] = 1'b0 ;
  865. assign hard00_SBACKO = 1'b0 ;
  866. assign spi_pirq_o[0] = 1'b0 ;
  867. assign spi_pwkup_o[0] = 1'b0 ;
  868. end
  869. if ((spi_right_enable == 1))
  870. begin : genblk12
  871. SPI_B #(.FREQUENCY_PIN_SBCLKI(FREQUENCY_PIN_SBCLKI),
  872. .SPI_CLK_DIVIDER(SPI_RIGHT_CLK_PRESCALE),
  873. .BUS_ADDR74("0b0010")) u_SPI_B_INST_RT (.SBCLKI(sb_clk_i),
  874. .SBRWI(wb_we_ix),
  875. .SBSTBI(wb_stb_ix),
  876. .SBADRI7(wb_adr_ix[7]),
  877. .SBADRI6(wb_adr_ix[6]),
  878. .SBADRI5(wb_adr_ix[5]),
  879. .SBADRI4(wb_adr_ix[4]),
  880. .SBADRI3(wb_adr_ix[3]),
  881. .SBADRI2(wb_adr_ix[2]),
  882. .SBADRI1(wb_adr_ix[1]),
  883. .SBADRI0(wb_adr_ix[0]),
  884. .SBDATI7(wb_dat_ix[7]),
  885. .SBDATI6(wb_dat_ix[6]),
  886. .SBDATI5(wb_dat_ix[5]),
  887. .SBDATI4(wb_dat_ix[4]),
  888. .SBDATI3(wb_dat_ix[3]),
  889. .SBDATI2(wb_dat_ix[2]),
  890. .SBDATI1(wb_dat_ix[1]),
  891. .SBDATI0(wb_dat_ix[0]),
  892. .MI(SPI1_MI),
  893. .SI(SPI1_SI),
  894. .SCKI(SPI1_SCKi),
  895. .SCSNI(SPI1_SCSNi),
  896. .SBDATO7(hard10_SBDATo[7]),
  897. .SBDATO6(hard10_SBDATo[6]),
  898. .SBDATO5(hard10_SBDATo[5]),
  899. .SBDATO4(hard10_SBDATo[4]),
  900. .SBDATO3(hard10_SBDATo[3]),
  901. .SBDATO2(hard10_SBDATo[2]),
  902. .SBDATO1(hard10_SBDATo[1]),
  903. .SBDATO0(hard10_SBDATo[0]),
  904. .SBACKO(hard10_SBACKO),
  905. .SPIIRQ(spi_pirq_o[1]),
  906. .SPIWKUP(spi_pwkup_o[1]),
  907. .SO(SPI1_SO),
  908. .SOE(SPI1_SOoe),
  909. .MO(SPI1_MO),
  910. .MOE(SPI1_MOoe),
  911. .SCKO(SPI1_SCKo),
  912. .SCKOE(SPI1_SCKoe),
  913. .MCSNO3(SPI1_MCSNo[3]),
  914. .MCSNO2(SPI1_MCSNo[2]),
  915. .MCSNO1(SPI1_MCSNo[1]),
  916. .MCSNO0(SPI1_MCSNo[0]),
  917. .MCSNOE3(SPI1_MCSNoe[3]),
  918. .MCSNOE2(SPI1_MCSNoe[2]),
  919. .MCSNOE1(SPI1_MCSNoe[1]),
  920. .MCSNOE0(SPI1_MCSNoe[0])) ;
  921. end
  922. else
  923. begin : genblk12
  924. assign hard10_SBDATo[7] = 1'b0 ;
  925. assign hard10_SBDATo[6] = 1'b0 ;
  926. assign hard10_SBDATo[5] = 1'b0 ;
  927. assign hard10_SBDATo[4] = 1'b0 ;
  928. assign hard10_SBDATo[3] = 1'b0 ;
  929. assign hard10_SBDATo[2] = 1'b0 ;
  930. assign hard10_SBDATo[1] = 1'b0 ;
  931. assign hard10_SBDATo[0] = 1'b0 ;
  932. assign hard10_SBACKO = 1'b0 ;
  933. assign spi_pirq_o[1] = 1'b0 ;
  934. assign spi_pwkup_o[1] = 1'b0 ;
  935. end
  936. endgenerate
  937. endmodule