Line 198... |
Line 198... |
wire enable;
|
wire enable;
|
|
|
// Write and read enable signals
|
// Write and read enable signals
|
assign write_en = PSEL & PENABLE & PWRITE;
|
assign write_en = PSEL & PENABLE & PWRITE;
|
assign read_en = (PSEL & ~PWRITE)?1'b1:1'b0;
|
assign read_en = (PSEL & ~PWRITE)?1'b1:1'b0;
|
//((PSEL & ~PWRITE)&(PADDR >= AES_KEYR0 & PADDR <= AES_IVR3))?1'b1:1'b0;
|
|
|
|
// Configuration Register Logic
|
// Configuration Register Logic
|
assign dma_out_en = aes_cr[10];
|
assign dma_out_en = aes_cr[10];
|
assign dma_in_en = aes_cr[9];
|
assign dma_in_en = aes_cr[9];
|
assign err_ie = aes_cr[8];
|
assign err_ie = aes_cr[8];
|
Line 271... |
Line 270... |
|
|
// Computation Complete Flag
|
// Computation Complete Flag
|
if(ccf_set)
|
if(ccf_set)
|
ccf <= 1'b1;
|
ccf <= 1'b1;
|
else
|
else
|
if(ccfc && aes_cr_wr_en && access_permission)
|
if(ccfc && aes_cr_wr_en )//&& access_permission)
|
ccf <= 1'b0;
|
ccf <= 1'b0;
|
end
|
end
|
end
|
end
|
// Interruption on erros Signals
|
// Interruption on erros Signals
|
assign int_ccf = ccf_ie & ccf_set;
|
assign int_ccf = ccf_ie & ccf_set;
|
Line 401... |
Line 400... |
end
|
end
|
|
|
assign col_addr = cnt;
|
assign col_addr = cnt;
|
assign col_wr_en = (PADDR == AES_DINR && write_en && state == INPUT);
|
assign col_wr_en = (PADDR == AES_DINR && write_en && state == INPUT);
|
assign col_rd_en = (PADDR == AES_DOUTR && read_en && state == OUTPUT);
|
assign col_rd_en = (PADDR == AES_DOUTR && read_en && state == OUTPUT);
|
assign wr_err_en = (PADDR == AES_DINR && write_en && (state != INPUT && state != IDLE));
|
assign wr_err_en = (PENABLE && PADDR == AES_DINR && write_en && (state != INPUT && state != IDLE));
|
assign rd_err_en = (PADDR == AES_DOUTR && read_en && (state != OUTPUT && state != IDLE));
|
assign rd_err_en = (PENABLE && PADDR == AES_DOUTR && read_en && (state != OUTPUT && state != IDLE));
|
|
|
// DMA Requests Logic
|
// DMA Requests Logic
|
always @(posedge PCLK, negedge PRESETn)
|
always @(posedge PCLK, negedge PRESETn)
|
begin
|
begin
|
if(!PRESETn)
|
if(!PRESETn)
|