OpenCores
URL https://opencores.org/ocsvn/apbtoaes128/apbtoaes128/trunk

Subversion Repositories apbtoaes128

[/] [apbtoaes128/] [trunk/] [pli/] [bfm_error/] [aes_bfm_wr_error_doutr.h] - Diff between revs 4 and 12

Show entire file | Details | Blame | View Log

Rev 4 Rev 12
Line 120... Line 120...
                                {
                                {
                                        STATE = WRITE;
                                        STATE = WRITE;
 
 
                                        counter = 0;
                                        counter = 0;
 
 
                                        v_wr.value.integer = vector_address[0];
                                        v_wr.value.integer = 0;
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
 
                                        v_wr.value.integer = 0;
                                        v_wr.value.integer = 0;
                                        vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay);
                                        vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay);
 
 
Line 239... Line 239...
 
 
 
 
                                        }else if(counter_write == 9)
                                        }else if(counter_write == 9)
                                        {
                                        {
 
 
                                                v_wr.value.integer = vector_address[0];
                                                v_wr.value.integer = ADDR_AES_CR;
                                                vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
                                                vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
 
                                                if(PACKETS_GENERATED == 0)//ENCRYPTION
                                                v_wr.value.integer = vector_CR[PACKETS_GENERATED];
                                                {
 
 
 
                                                        v_wr.value.integer = 1;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 1)//ENCRYPTION
 
                                                {
 
 
 
                                                        v_wr.value.integer = 1025;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 2)//KEY GENERATION
 
                                                {
 
 
 
                                                        v_wr.value.integer = 9;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 3)//KEY GENERATION
 
                                                {
 
 
 
                                                        v_wr.value.integer = 1033;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 4)//DECRYPTION
 
                                                {
 
 
 
                                                        v_wr.value.integer = 17;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 5)//DECRYPTION
 
                                                {
 
 
 
                                                        v_wr.value.integer = 1041;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 6)//DEVIRATION_DECRYPTION
 
                                                {
 
 
 
                                                        v_wr.value.integer = 25;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 7)//DEVIRATION_DECRYPTION
 
                                                {
 
 
 
                                                        v_wr.value.integer = 1049;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 8)//ENCRYPTION_DMA
 
                                                {
 
 
 
                                                        v_wr.value.integer = 6145;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 9)//ENCRYPTION_DMA
 
                                                {
 
 
 
                                                        v_wr.value.integer = 7169;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 10)//KEY DERIVATION DMA
 
                                                {
 
 
 
                                                        v_wr.value.integer = 6153;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 12)//KEY DERIVATION DMA
 
                                                {
 
 
 
                                                        v_wr.value.integer = 7177;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 13)//DECRYPTION_DMA
 
                                                {
 
 
 
                                                        v_wr.value.integer = 6161;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 14)//DECRYPTION_DMA
 
                                                {
 
 
 
                                                        v_wr.value.integer = 7185;
 
 
 
 
 
                                                }else if(PACKETS_GENERATED == 15)//DEVIRATION_DECRYPTION_DMA
 
                                                {
 
 
 
                                                        v_wr.value.integer = 6169;
 
 
 
                                                }else if(PACKETS_GENERATED == 16)//DEVIRATION_DECRYPTION_DMA
 
                                                {
 
 
 
                                                        v_wr.value.integer = 7193;
 
 
 
                                                }
 
 
 
                                                vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay);
                                                vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay);
 
 
                                        }if(counter_write > 9  &&  counter_write < 14) //WRITE DINR
                                        }if(counter_write > 9  &&  counter_write < 14) //WRITE DINR
                                        {
                                        {
 
 
Line 425... Line 330...
                                {
                                {
                                        STATE =WAIT;
                                        STATE =WAIT;
                                        counter_write = 0;
                                        counter_write = 0;
                                        counter_read  = 0;
                                        counter_read  = 0;
 
 
 
 
 
 
 
 
                                }
                                }
 
 
 
 
                        break;
                        break;
 
 
Line 442... Line 344...
                                vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
                                vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
 
 
                                v_wr.value.integer = 0;
                                v_wr.value.integer = 0;
                                vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
                                vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
                                if(counter_wait == 9)
                                if(counter_wait == 3)
                                {
                                {
 
 
                                        STATE = READ_DOUTR;
                                        STATE = READ_DOUTR;
                                        counter_wait=0;
                                        counter_wait=0;
 
                                        counter=1;
                                        v_wr.value.integer = ADDR_AES_DOUTR;
 
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        v_wr.value.integer = 0;
 
                                        vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
 
 
 
                                }else
                                }else
                                {
                                {
 
 
 
                                        v_wr.value.integer = ADDR_AES_CR;
 
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
 
                                        counter_wait++;
                                        counter_wait++;
 
 
                                }
                                }
                        break;
                        break;
 
 
                        case READ_DOUTR:
                        case READ_DOUTR:
 
 
                                v_wr.value.integer = 0;
 
                                vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                if(counter == 0)
                                if(counter == 0)
                                {
                                {
 
 
                                        counter++;
                                        counter++;
                                        counter_write++;
                                        counter_read++;
 
 
                                        v_wr.value.integer = 1;
                                        v_wr.value.integer = 1;
                                        vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
                                        vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
 
 
 
 
Line 484... Line 381...
                                {
                                {
 
 
                                        v_wr.value.integer = 0;
                                        v_wr.value.integer = 0;
                                        vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
                                        vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
 
 
 
 
 
                                        v_wr.value.integer = ADDR_AES_DOUTR;
 
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
 
                                        counter=0;
                                        counter=0;
                                }
                                }
 
 
 
 
 
 
                                if(counter_write == 14)
                                if(counter_read == 4)
                                {
                                {
                                        STATE = READ_RESULTS;
                                        STATE = READ_RESULTS;
                                        counter_write = 0;
                                        counter_write = 0;
                                        counter_read  = 0;
                                        counter_read  = 0;
 
                                        counter=1;
                                        v_wr.value.integer = ADDR_AES_DINR;//vector_address[counter_read];
 
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        v_wr.value.integer = 0;
 
                                        vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
 
 
 
                                }
                                }
 
 
 
 
                        break;
                        break;
 
 
Line 522... Line 416...
                                        counter_read++;
                                        counter_read++;
                                        counter++;
                                        counter++;
 
 
                                }else if(counter == 1)
                                }else if(counter == 1)
                                {
                                {
                                        counter++;
 
 
 
 
 
                                        v_wr.value.integer = 0;
                                        v_wr.value.integer = 0;
                                        vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
                                        vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        if(counter_read == 0)
 
                                        {
 
                                                v_wr.value.integer = 1;
 
                                                vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
                                        v_wr.value.integer = ADDR_AES_SR;//vector_address[counter_read];
                                                v_wr.value.integer = ADDR_AES_CR;
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
 
                                        v_wr.value.integer = 0;
                                        v_wr.value.integer = 0;
                                        vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay);
                                        vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay);
 
 
                                        v_wr.value.integer = 1;
                                        v_wr.value.integer = 1;
                                        vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay);
                                        vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay);
 
                                        }else
 
                                        {
 
                                                v_wr.value.integer = 0;
 
                                                vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                                v_wr.value.integer = ADDR_AES_SR;
 
                                                vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
 
 
 
 
                                        }
 
 
                                        counter=0;
                                        counter=0;
 
 
                                }
                                }
 
 
                                if(counter_read == 1)
                                if(counter_read == 14)
                                {
                                {
                                        STATE = IDLE;
                                        STATE = RESET_SR;
 
                                        counter_write = 0;
                                        counter_read = 0;
                                        counter_read = 0;
                                        PACKETS_GENERATED = PACKETS_GENERATED + 1;
                                        PACKETS_GENERATED = PACKETS_GENERATED + 1;
 
                                        counter=1;
 
 
 
                                }
 
 
 
                        break;
 
 
 
                        case RESET_SR:
 
 
 
 
 
 
 
 
 
                                if(counter == 0)
 
                                {
 
 
 
                                        counter_write++;
 
                                        counter++;
 
 
 
                                        v_wr.value.integer = 1;
 
                                        vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                }else if(counter == 1)
 
                                {
 
 
                                        v_wr.value.integer = 0;
                                        v_wr.value.integer = 0;
                                        vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
                                        vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        v_wr.value.integer = 1;
 
                                        vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        v_wr.value.integer = 1;
 
                                        vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        v_wr.value.integer = 0;
 
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        v_wr.value.integer = 384;
 
                                        vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        counter=0;
 
 
                                }
                                }
 
 
 
                                if(counter_write == 2)
 
                                {
 
                                        STATE =IDLE;
 
                                        counter_write = 0;
 
                                        counter_read  = 0;
 
                                }
 
 
 
 
 
 
                        break;
                        break;
                }
                }
 
 
 
 
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.