p; else nextstat=idle; end write: begin if(wb_adr_i=={mycore_adr,24'h000000}) begin Cal_A=wb_dat_i; A_Status=1'b1; //wb_ack_o=1'b1; end else if(wb_adr_i=={mycore_adr,24'h000004}) begin Cal_B=wb_dat_i; B_Status=1'b1; //wb_ack_o=1'b1; end else begin //wb_ack_o=1'b0; end if(A_Status && B_Status) nextstat=operate; else nextstat=idle; end read: begin if(wb_adr_i=={mycore_adr,24'h000000}) begin wb_dat_o=Cal_A; //wb_ack_o=1'b1; end else if(wb_adr_i=={mycore_adr,24'h000004}) begin wb_dat_o=Cal_B; //wb_ack_o=1'b1; end else if(wb_adr_i=={mycore_adr,24'h000008}) begin wb_dat_o=Result; //wb_ack_o=1'b1; end else begin wb_dat_o=0; //wb_ack_o=0; end nextstat=idle; end operate: begin Result=Cal_A+Cal_B; A_Status=0; B_Status=0; R_Status=1'b1; nextstat=idle; wb_dat_o=0; //wb_ack_o=0; end default: begin Cal_A=0; Cal_B=0; R_Status=0; A_Status=0; B_Status=0; R_Status=0; wb_dat_o=0; //wb_ack_o=0; nextstat=idle; end endcase always @(posedge wb_clk) if(wb_rst) begin wb_ack_o<=0; end else if(wb_stb_i & !wb_ack_o & (wb_adr_i[31:24]==8'b10010111)) begin &n上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] ... 下一页 >>
|