bitu_tzp
Newbie level 4
I am trying to understand SPI protocols. So i tried to model a SPI master device. But whien i synthesize i get warnings like
1. Xst:1306 - Output <rcx_buffer> is never assigned.
2. Xst:646 - Signal <rcx_buff<0>> is assigned but never used. This unconnected signal will be trimmed during the optimization process.
my code is:
1. Xst:1306 - Output <rcx_buffer> is never assigned.
2. Xst:646 - Signal <rcx_buff<0>> is assigned but never used. This unconnected signal will be trimmed during the optimization process.
my code is:
Code Verilog - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 module master(inp,pin,rst,miso,sck,mosi,trans_buff,send_buff,rcx_buffer); input sck,rst,miso,pin; input [7:0] inp; output mosi; output [7:0] trans_buff,send_buff; output [7:0] rcx_buffer; reg mosi; reg [7:0] trans_buff; // buffer for storing the byte to send reg [7:0] send_buff; // buffer for the byte to be send reg [7:0] rcx_buff=8'b00000000; // buffer for storing the byte received always @(posedge sck) begin if(rst) begin trans_buff=8'b00000000; send_buff=8'b00000000; end else begin if(pin) trans_buff=inp; //capturing the input else begin send_buff[0]=trans_buff[7]; //copy msb of trans_buff in send_buff mosi=send_buff[7]; //send msb first send_buff=send_buff<<1; // left shift for next bit to send trans_buff=trans_buff<<1; end end end always @(negedge sck) begin rcx_buff[0]=miso; //capture serial input in negedge of sck rcx_buff=rcx_buff<<1; end endmodul
Last edited by a moderator: