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

Subversion Repositories apbtoaes128

[/] [apbtoaes128/] [trunk/] [pli/] [bfm_error/] [aes_bfm_wr_error_dinr.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(PENABLE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        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(PWRITE, &v_wr, NULL, vpiNoDelay);
                                        vpi_put_value(PWRITE, &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);
 
 
                                }
                                }
 
 
 
 
 
 
                        break;
                        break;
 
 
                        case WRITE:
                        case WRITE:
 
 
 
 
 
 
 
 
 
 
                                if(counter == 0)
                                if(counter == 0)
                                {
                                {
 
 
                                        counter_write++;
 
                                        counter++;
                                        counter++;
 
                                        counter_write++;
 
 
                                        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 155... Line 164...
                                {
                                {
 
 
                                        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);
 
 
                                        t_wr.type = vpiScaledRealTime;
 
                                        t_wr.real = 0;
 
                                        v_wr.format=vpiIntVal;
 
 
 
                                        if(counter_write < 9)
                                        if(counter_write < 9)
                                        {
                                        {
 
 
                                        v_wr.value.integer = vector_address[counter_write];
                                        v_wr.value.integer = vector_address[counter_write];
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
 
                                                if(FIPS_ENABLE == FIPS)
 
                                                {
 
 
 
                                                        if(vector_address[counter_write] == ADDR_AES_KEYR3 || vector_address[counter_write] == ADDR_AES_IVR3)
                                                        if(vector_address[counter_write] == ADDR_AES_KEYR3 || vector_address[counter_write] == ADDR_AES_IVR3)
                                                        {
                                                        {
 
 
                                                                a = a | KEY_FIPS_NOT_DERIVATED[0];
                                                                a = a | KEY_FIPS_NOT_DERIVATED[0];
                                                                a = a << 8;
                                                                a = a << 8;
                                                                a = a | KEY_FIPS_NOT_DERIVATED[1];
                                                                a = a | KEY_FIPS_NOT_DERIVATED[1];
                                                                a = a << 8;
                                                                a = a << 8;
                                                                a = a | KEY_FIPS_NOT_DERIVATED[2];
                                                                a = a | KEY_FIPS_NOT_DERIVATED[2];
                                                                a = a << 8;
                                                                a = a << 8;
                                                                a = a | KEY_FIPS_NOT_DERIVATED[3];
                                                                a = a | KEY_FIPS_NOT_DERIVATED[3];
                                                                v_wr.value.integer = a;
                                                                v_wr.value.integer = a;
                                                        }
                                                        }
 
 
 
 
                                                        if(vector_address[counter_write] == ADDR_AES_KEYR2 || vector_address[counter_write] == ADDR_AES_IVR2)
                                                        if(vector_address[counter_write] == ADDR_AES_KEYR2 || vector_address[counter_write] == ADDR_AES_IVR2)
                                                        {
                                                        {
 
 
                                                                b = b | KEY_FIPS_NOT_DERIVATED[4];
                                                                b = b | KEY_FIPS_NOT_DERIVATED[4];
                                                                b = b << 8;
                                                                b = b << 8;
                                                                b = b | KEY_FIPS_NOT_DERIVATED[5];
                                                                b = b | KEY_FIPS_NOT_DERIVATED[5];
                                                                b = b << 8;
                                                                b = b << 8;
                                                                b = b | KEY_FIPS_NOT_DERIVATED[6];
                                                                b = b | KEY_FIPS_NOT_DERIVATED[6];
                                                                b = b << 8;
                                                                b = b << 8;
                                                                b = b | KEY_FIPS_NOT_DERIVATED[7];
                                                                b = b | KEY_FIPS_NOT_DERIVATED[7];
                                                                v_wr.value.integer = b;
                                                                v_wr.value.integer = b;
 
 
                                                        }
                                                        }
 
 
                                                        if(vector_address[counter_write] == ADDR_AES_KEYR1 || vector_address[counter_write] == ADDR_AES_IVR1)
                                                        if(vector_address[counter_write] == ADDR_AES_KEYR1 || vector_address[counter_write] == ADDR_AES_IVR1)
                                                        {
                                                        {
 
 
                                                                c = c | KEY_FIPS_NOT_DERIVATED[8];
                                                                c = c | KEY_FIPS_NOT_DERIVATED[8];
                                                                c = c << 8;
                                                                c = c << 8;
                                                                c = c | KEY_FIPS_NOT_DERIVATED[9];
                                                                c = c | KEY_FIPS_NOT_DERIVATED[9];
                                                                c = c << 8;
                                                                c = c << 8;
                                                                c = c | KEY_FIPS_NOT_DERIVATED[10];
                                                                c = c | KEY_FIPS_NOT_DERIVATED[10];
                                                                c = c << 8;
                                                                c = c << 8;
                                                                c = c | KEY_FIPS_NOT_DERIVATED[11];
                                                                c = c | KEY_FIPS_NOT_DERIVATED[11];
                                                                v_wr.value.integer = c;
                                                                v_wr.value.integer = c;
 
 
                                                        }
                                                        }
 
 
 
 
                                                        if(vector_address[counter_write] == ADDR_AES_KEYR0 || vector_address[counter_write] == ADDR_AES_IVR0)
                                                        if(vector_address[counter_write] == ADDR_AES_KEYR0 || vector_address[counter_write] == ADDR_AES_IVR0)
                                                        {
                                                        {
 
 
                                                                d = d | KEY_FIPS_NOT_DERIVATED[12];
                                                                d = d | KEY_FIPS_NOT_DERIVATED[12];
                                                                d = d << 8;
                                                                d = d << 8;
                                                                d = d | KEY_FIPS_NOT_DERIVATED[13];
                                                                d = d | KEY_FIPS_NOT_DERIVATED[13];
                                                                d = d << 8;
                                                                d = d << 8;
                                                                d = d | KEY_FIPS_NOT_DERIVATED[14];
                                                                d = d | KEY_FIPS_NOT_DERIVATED[14];
                                                                d = d << 8;
                                                                d = d << 8;
                                                                d = d | KEY_FIPS_NOT_DERIVATED[15];
                                                                d = d | KEY_FIPS_NOT_DERIVATED[15];
                                                                v_wr.value.integer = d;
                                                                v_wr.value.integer = d;
                                                        }
 
 
 
 
 
 
 
                                                }else if(FIPS_ENABLE == RANDOM_DATA)
 
                                                {
 
                                                        v_wr.value.integer = data_in(rd);
 
                                                }
                                                }
                                                vpi_put_value(PWDATA, &v_wr, &t_wr, vpiTransportDelay);
 
 
                                        vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay);
 
 
                                                a = 0;
                                                a = 0;
                                                b = 0;
                                                b = 0;
                                                c = 0;
                                                c = 0;
                                                d = 0;
                                                d = 0;
 
 
                                                v_wr.value.integer = 1;
                                        }else if(counter_write == 9)//ENABLE CR
                                                vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay);
 
 
 
 
 
                                        }else if(counter_write == 9)
 
                                        {
                                        {
 
                                                v_wr.value.integer = ADDR_AES_CR;
                                                v_wr.value.integer = vector_address[0];
 
                                                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
                                        }else if(counter_write > 9  &&  counter_write < 14) //WRITE DINR
                                        {
                                        {
 
 
                                                v_wr.value.integer = ADDR_AES_DINR;
                                                v_wr.value.integer = ADDR_AES_DINR;
                                                vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
                                                vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
 
 
 
                                                if(FIPS_ENABLE == FIPS)
 
                                                {
 
 
 
                                                        if(counter_write == 10)
                                                        if(counter_write == 10)
                                                        {
                                                        {
                                                                a = a | TEXT_FIPS_DERIVATED[0];
                                                                a = a | TEXT_FIPS_NOT_DERIVATED[0];
                                                                a = a << 8;
                                                                a = a << 8;
                                                                a = a | TEXT_FIPS_DERIVATED[1];
                                                                a = a | TEXT_FIPS_NOT_DERIVATED[1];
                                                                a = a << 8;
                                                                a = a << 8;
                                                                a = a | TEXT_FIPS_DERIVATED[2];
                                                                a = a | TEXT_FIPS_NOT_DERIVATED[2];
                                                                a = a << 8;
                                                                a = a << 8;
                                                                a = a | TEXT_FIPS_DERIVATED[3];
                                                                a = a | TEXT_FIPS_NOT_DERIVATED[3];
                                                                v_wr.value.integer = a;
                                                                v_wr.value.integer = a;
 
 
                                                        }else if(counter_write == 11)
                                                        }else if(counter_write == 11)
                                                        {
                                                        {
                                                                b = b | TEXT_FIPS_DERIVATED[4];
                                                                b = b | TEXT_FIPS_NOT_DERIVATED[4];
                                                                b = b << 8;
                                                                b = b << 8;
                                                                b = b | TEXT_FIPS_DERIVATED[5];
                                                                b = b | TEXT_FIPS_NOT_DERIVATED[5];
                                                                b = b << 8;
                                                                b = b << 8;
                                                                b = b | TEXT_FIPS_DERIVATED[6];
                                                                b = b | TEXT_FIPS_NOT_DERIVATED[6];
                                                                b = b << 8;
                                                                b = b << 8;
                                                                b = b | TEXT_FIPS_DERIVATED[7];
                                                                b = b | TEXT_FIPS_NOT_DERIVATED[7];
                                                                v_wr.value.integer = b;
                                                                v_wr.value.integer = b;
 
 
                                                        }else if(counter_write == 12 )
                                                        }else if(counter_write == 12 )
                                                        {
                                                        {
 
 
                                                                c = c | TEXT_FIPS_DERIVATED[8];
                                                                c = c | TEXT_FIPS_NOT_DERIVATED[8];
                                                                c = c << 8;
                                                                c = c << 8;
                                                                c = c | TEXT_FIPS_DERIVATED[9];
                                                                c = c | TEXT_FIPS_NOT_DERIVATED[9];
                                                                c = c << 8;
                                                                c = c << 8;
                                                                c = c | TEXT_FIPS_DERIVATED[10];
                                                                c = c | TEXT_FIPS_NOT_DERIVATED[10];
                                                                c = c << 8;
                                                                c = c << 8;
                                                                c = c | TEXT_FIPS_DERIVATED[11];
                                                                c = c | TEXT_FIPS_NOT_DERIVATED[11];
                                                                v_wr.value.integer = c;
                                                                v_wr.value.integer = c;
 
 
                                                        }else if(counter_write == 13 )
                                                        }else if(counter_write == 13 )
                                                        {
                                                        {
                                                                d = d | TEXT_FIPS_DERIVATED[12];
                                                                d = d | TEXT_FIPS_NOT_DERIVATED[12];
                                                                d = d << 8;
                                                                d = d << 8;
                                                                d = d | TEXT_FIPS_DERIVATED[13];
                                                                d = d | TEXT_FIPS_NOT_DERIVATED[13];
                                                                d = d << 8;
                                                                d = d << 8;
                                                                d = d | TEXT_FIPS_DERIVATED[14];
                                                                d = d | TEXT_FIPS_NOT_DERIVATED[14];
                                                                d = d << 8;
                                                                d = d << 8;
                                                                d = d | TEXT_FIPS_DERIVATED[15];
                                                                d = d | TEXT_FIPS_NOT_DERIVATED[15];
                                                                v_wr.value.integer = d;
                                                                v_wr.value.integer = d;
 
 
                                                        }
                                                        }
 
 
 
                                                        vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay);
 
 
                                                }else if(FIPS_ENABLE == RANDOM_DATA)
 
                                                {
 
                                                        v_wr.value.integer = data_in(rd);
 
                                                }
 
 
 
                                                vpi_put_value(PWDATA, &v_wr, &t_wr, vpiTransportDelay);
 
 
 
                                                a = 0;
                                                a = 0;
                                                b = 0;
                                                b = 0;
                                                c = 0;
                                                c = 0;
                                                d = 0;
                                                d = 0;
 
 
 
 
                                        }
                                        }
 
 
                                        counter=0;
                                        counter=0;
 
                                }
 
 
                                }//ELSE COUNTER
 
 
 
 
 
 
 
                                if(counter_write == 14)
                                if(counter_write == 14)
                                {
                                {
                                        STATE =WAIT;
 
                                        counter_write = 0;
                                        counter_write = 0;
                                        counter_read  = 0;
                                        STATE = WAIT;
 
 
                                        //v_wr.value.integer = 0;
 
                                        //vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
 
 
 
                                }
                                }
 
 
 
 
                        break;
                        break;
 
 
                        case WAIT:
                        case WAIT:
 
 
 
 
                                v_wr.value.integer = 0;
 
                                vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                v_wr.value.integer = 0;
 
                                vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                if(counter_wait == 9)
                                if(counter_wait == 1)
                                {
                                {
 
 
 
                                        v_wr.value.integer = 1;
 
                                        vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
                                        STATE = WRITE_DINR;
                                        STATE = WRITE_DINR;
                                        counter_wait=0;
                                        counter_wait=0;
 
                                        counter_write = 0;
                                        v_wr.value.integer = ADDR_AES_DINR;
                                        counter=1;
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        v_wr.value.integer = 0;
 
                                        vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
 
 
 
                                }else
                                }else
                                {
                                {
 
 
                                        counter_wait++;
                                        counter_wait++;
 
 
 
                                        v_wr.value.integer = 0;
 
                                        vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        v_wr.value.integer = 0;
 
                                        vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
                                }
                                }
                        break;
                        break;
 
 
                        case WRITE_DINR:
                        case WRITE_DINR:
 
 
                                v_wr.value.integer = 1;
 
                                vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                if(counter == 0)
                                if(counter == 0)
                                {
                                {
 
 
                                        counter++;
                                        counter++;
Line 485... Line 369...
                                {
                                {
 
 
                                        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_write == 13)//ENABLE CR
 
                                        {
 
 
 
                                                v_wr.value.integer =1;
 
                                                vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                                v_wr.value.integer = ADDR_AES_CR;
 
                                                vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
 
 
                                                v_wr.value.integer = 0;
 
                                                vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        }else
 
                                        {
 
                                                v_wr.value.integer = ADDR_AES_DINR;
 
                                                vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
                                        }
 
 
 
 
                                        counter=0;
                                        counter=0;
                                }
                                }
 
 
 
 
 
 
                                if(counter_write == 14)
                                if(counter_write == 14)
                                {
                                {
                                        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;
 
 
                        case READ_RESULTS:
                        case READ_RESULTS:
 
 
 
 
 
 
 
                                v_wr.value.integer = 0;
 
                                vpi_put_value(PWRITE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                v_wr.value.integer = 1;
 
                                vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay);
 
 
                                if(counter == 0)
                                if(counter == 0)
                                {
                                {
 
 
                                        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);
 
 
                                        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);
 
 
 
 
                                        v_wr.value.integer = ADDR_AES_SR;//vector_address[counter_read];
                                        if(counter_read <= 9)
 
                                        {
 
                                                v_wr.value.integer = vector_address[counter_read];
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
                                        vpi_put_value(PADDR, &v_wr, NULL, vpiNoDelay);
 
                                        }
 
                                        else
 
                                        {
 
 
 
 
 
                                        }
 
 
                                        v_wr.value.integer = 0;
 
                                        vpi_put_value(PWDATA, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        v_wr.value.integer = 1;
 
                                        vpi_put_value(PSEL, &v_wr, NULL, vpiNoDelay);
 
 
 
                                        counter=0;
                                        counter=0;
 
 
                                }
                                }
 
 
                                if(counter_read == 12)
                                if(counter_read == 14)
                                {
                                {
                                        STATE = RESET_SR;
                                        STATE = RESET_SR;
                                        counter_read = 0;
                                        counter_read = 0;
                                        PACKETS_GENERATED = PACKETS_GENERATED + 1;
                                        PACKETS_GENERATED = PACKETS_GENERATED + 1;
 
 
                                        v_wr.value.integer = 0;
                                        counter=1;
                                        vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
 
 
 
                                }
                                }
 
 
                        break;
                        break;
 
 
                case RESET_SR:
                case RESET_SR:
 
 
                                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);
 
 
 
 
 
                                if(counter == 0)
                                if(counter == 0)
                                {
                                {
 
 
Line 585... Line 480...
                                }else if(counter == 1)
                                }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;
                                        counter=0;
 
 
                                }
                                }
 
 
                                if(counter_write < 2)
                                if(counter_write == 2)
                                {
                                {
                                        STATE =IDLE;
                                        STATE =IDLE;
                                        counter_write = 0;
                                        counter_write = 0;
 
                                        counter=1;
 
                                        v_wr.value.integer = 0;
 
                                        vpi_put_value(PENABLE, &v_wr, NULL, vpiNoDelay);
                                }
                                }
 
 
 
 
 
 
                break;
                break;

powered by: WebSVN 2.1.0

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