CSC 242:-Computer-Aided Systems Design and Verification: Assignment 5
Status Report This project is functionally working perfect. Class / Object was successfully implemented and the test cases of DUT were validated using constrained-based randomization to generate test vectors (varying transaction type, size, width, data etc.). Mod-ports, clocking blocks and program were successfully implemented. Also, we have done Functionality Coverage with cover-point like width, size and type. And we are getting the Functionality Coverage of 100%.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
103 views34 pages
CSC 242:-Computer-Aided Systems Design and Verification: Assignment 5
Status Report This project is functionally working perfect. Class / Object was successfully implemented and the test cases of DUT were validated using constrained-based randomization to generate test vectors (varying transaction type, size, width, data etc.). Mod-ports, clocking blocks and program were successfully implemented. Also, we have done Functionality Coverage with cover-point like width, size and type. And we are getting the Functionality Coverage of 100%.
Class/Object was successfully implemented and the test cases of DUT were validated using constrained-based randomization to generate test vectors (varying transaction type, size, width, data etc.).
Mod-ports, clocking blocks and program were successfully implemented.
Also, we have done functionality coverage with cover-point like width, size and type. And we are getting the functionality coverage of 100%.
After implementing all these (Class/Object, Mod-ports, Clocking- block, program and Functionality Coverage), simulation results for all transfers are coming correct.
4
2. Block Diagram for Design
TESTBENCH (Program) [31:0]dma_wdata CLIENT [0,1,2,3] ARBITER MEMORY SEL CPU_PROMPT CPU_TYPE CPU_WIDTH CPU_ADDR CPU_DATA CPU_SIZE CLOCK RESET CLOCK RESET CLOCK RESET [31:0]DMA_ADDR [31:0]DMA_WDATA [31:0]DMA_RDATA DMA_COMPLETE [2:0]DMA_WIDTH [3:0]DMA_SIZE DMA_TRANS DMA_TYPE INTERFACE (dbus) R e q [ 3 : 0 ] G n t [ 3 : 0 ] CLOCK RESET S i z e [ 3 : 0 ] Master[1:0]
5
3. Block Diagram of Testbench
RESET SEL CPU_PROMPT CPU_SIZE CPU-DATA CPU_WIDTH BUSY CONFIG_DONE CPU_TYPE CPU_ADDR PROGRAM (client_test) CLASS(config_client) Bit RESET randc bit CPU_TYPE Logic [31:0]CPU_ADDR randc bit[2:0]CPU_WIDTH Bit CPU_PROMPT rand bit [31:0]CPU_DATA rand logic [4:0]CPU_SIZE Logic[1:0]SEL
data_phase: if(dbus.DMA_SIZE==5'b00001) begin nextstate=idle; end else nextstate=data_phase;
endcase end
always_ff @ (posedge CLOCK) begin case(state) idle: begin REQ<=0; config_done<=1'b0; busy<=1'b0; end
config: begin cpu_type<=dbus.CPU_TYPE; cpu_addr<=dbus.CPU_ADDR; cpu_width<=dbus.CPU_WIDTH; cpu_size<=dbus.CPU_SIZE; cpu_data<=dbus.CPU_DATA; config_done<=1'b1; busy<=1'b1; end
wait_config: begin config_done<=1'b1; busy<=1'b1;
if(dbus.CPU_PROMPT==1) begin REQ<=1'b1; dbus.STATUS<=1'b1; end else begin REQ<=1'b0; 10
dbus.STATUS<=1'b0; end end
wait_grant: begin
REQ<=1; busy<=1'b1; config_done<=1'b1; end
address_phase: begin REQ<=1'b0; busy<=1'b1; config_done<=1'b1;
dbus.DMA_WDATA<=32'bz; dbus.DMA_TRANS<=1'b1; dbus.DMA_ADDR<=cpu_addr; dbus.DMA_WIDTH<=cpu_width; dbus.DMA_SIZE<=cpu_size; dbus.DMA_TYPE<=cpu_type; end
data_phase: begin dbus.DMA_TRANS<=1'b0; config_done<=1'b1; busy<=1'b1; REQ<=1'b0;
if(dbus.DMA_TRANS) begin dma_width=dbus.DMA_WIDTH; dma_size=dbus.DMA_SIZE; dma_addr=dbus.DMA_ADDR; size=5'b00000; end else begin dma_width=3'bz; dma_size=5'bz; dma_addr=32'bz; end
end
write_more:
begin temp=dma_addr;
if(dma_width==3'b100) begin mem[temp]=dbus.DMA_WDATA[7:0]; mem[temp+1]=dbus.DMA_WDATA[15:8]; mem[temp+2]=dbus.DMA_WDATA[23:16]; mem[temp+3]=dbus.DMA_WDATA[31:24]; dma_wdata[7:0]=mem[temp]; dma_wdata[15:8]=mem[temp+1]; dma_wdata[23:16]=mem[temp+2]; dma_wdata[31:24]=mem[temp+3]; if(dbus.DMA_SIZE > 5'b00001) dma_addr=dma_addr+4; else dma_addr=32'bz; end else if(dma_width==3'b010) begin mem[temp]=dbus.DMA_WDATA[7:0]; 17
end else begin mem[temp]=dbus.DMA_WDATA[7:0]; dma_wdata[7:0]=mem[temp]; dma_wdata[31:8]=24'h0; if(dbus.DMA_SIZE > 5'b00001) dma_addr=dma_addr+1; else dma_addr=32'bz; end
if(dma_width==3'b100) begin dbus.DMA_RDATA[7:0]=mem[temp]; dbus.DMA_RDATA[15:8]=mem[temp+1]; dbus.DMA_RDATA[23:16]=mem[temp+2]; dbus.DMA_RDATA[31:24]=mem[temp+3]; if(dbus.DMA_SIZE > 5'b00001)
dma_addr=dma_addr+4; else dma_addr=32'bz; end else if(dma_width==3'b010) begin dbus.DMA_RDATA[7:0]=mem[temp]; dbus.DMA_RDATA[15:8]=mem[temp+1]; dbus.DMA_RDATA[31:16]=16'h0; if(dbus.DMA_SIZE > 5'b00001) dma_addr=dma_addr+2; else dma_addr=32'bz; end 18
else if(dma_width==3'b001) begin dbus.DMA_RDATA[7:0]=mem[temp]; dbus.DMA_RDATA[31:8]=24'h0; if(dbus.DMA_SIZE > 5'b00001) dma_addr=dma_addr+1; else dma_addr=32'bz; end else begin dbus.DMA_RDATA[31:0]=32'b1; dma_addr=32'bz; end end endcase end
endmodule
19
5. Source code for Testbench
Program for DUT
program automatic client_test(DMA_MEM dbus,output bit RESET,input [3:0]config_done,input [3:0]busy,output real cov);
class config_client; bit RESET; randc bit CPU_TYPE; logic [31:0]CPU_ADDR; randc bit [2:0] CPU_WIDTH; rand logic [4:0] CPU_SIZE; bit CPU_PROMPT; rand bit [31:0]CPU_DATA; logic [1:0]SEL;