Line 249... |
Line 249... |
|
|
|
|
}else if(counter_write == 9)//ENABLE CR
|
}else if(counter_write == 9)//ENABLE CR
|
{
|
{
|
|
|
|
if(DATATYPE == TYPE_00)// NO DINR DOUTR SWAP DATA
|
|
{
|
|
v_ecb.value.integer = ADDR_AES_CR;
|
|
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
|
|
|
|
v_ecb.value.integer = 6145;
|
|
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
|
|
|
|
}else if(DATATYPE == TYPE_01)// 16 BIT DINR DOUTR SWAP DATA
|
|
{
|
v_ecb.value.integer = ADDR_AES_CR;
|
v_ecb.value.integer = ADDR_AES_CR;
|
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
|
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
|
|
|
//v_ecb.value.integer = 1;
|
v_ecb.value.integer = 6147;
|
//vpi_put_value(PWDATA, &v_ecb, NULL, vpiNoDelay);
|
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
|
|
|
v_ecb.value.integer = 6145;//data_in(rd);
|
}else if(DATATYPE == TYPE_02)// 8 BIT DINR DOUTR SWAP DATA
|
|
{
|
|
v_ecb.value.integer = ADDR_AES_CR;
|
|
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
|
|
|
|
v_ecb.value.integer = 6149;
|
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
|
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
|
|
|
|
}else if(DATATYPE == TYPE_03)// BIT DINR DOUTR SWAP DATA
|
|
{
|
|
v_ecb.value.integer = ADDR_AES_CR;
|
|
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
|
|
|
|
v_ecb.value.integer = 6151;
|
|
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
|
|
}
|
}else if(counter_write > 9 && counter_write < 14) //WRITE DINR
|
}else if(counter_write > 9 && counter_write < 14) //WRITE DINR
|
{
|
{
|
|
|
v_ecb.value.integer = ADDR_AES_DINR;
|
v_ecb.value.integer = ADDR_AES_DINR;
|
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
|
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
|
|
|
|
|
if(FIPS_ENABLE == FIPS)
|
if(FIPS_ENABLE == FIPS)
|
{
|
{
|
|
|
|
if(DATATYPE == TYPE_00)
|
|
{
|
|
|
if(counter_write == 10)
|
if(counter_write == 10)
|
{
|
{
|
a = a | TEXT_FIPS_NOT_DERIVATED[0];
|
a = a | TEXT_FIPS_NOT_DERIVATED[0];
|
a = a << 8;
|
a = a << 8;
|
a = a | TEXT_FIPS_NOT_DERIVATED[1];
|
a = a | TEXT_FIPS_NOT_DERIVATED[1];
|
Line 315... |
Line 341... |
d = d | TEXT_FIPS_NOT_DERIVATED[15];
|
d = d | TEXT_FIPS_NOT_DERIVATED[15];
|
v_ecb.value.integer = d;
|
v_ecb.value.integer = d;
|
|
|
}
|
}
|
|
|
|
}else if(DATATYPE > TYPE_00)
|
|
{
|
|
|
|
|
|
if(counter_write == 10)
|
|
{
|
|
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[0];
|
|
a = a << 8;
|
|
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[1];
|
|
a = a << 8;
|
|
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[2];
|
|
a = a << 8;
|
|
a = a | TEXT_FIPS_NOT_DATATYPE_DERIVATED[3];
|
|
v_ecb.value.integer = a;
|
|
|
|
}else if(counter_write == 11)
|
|
{
|
|
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[4];
|
|
b = b << 8;
|
|
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[5];
|
|
b = b << 8;
|
|
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[6];
|
|
b = b << 8;
|
|
b = b | TEXT_FIPS_NOT_DATATYPE_DERIVATED[7];
|
|
v_ecb.value.integer = b;
|
|
|
|
}else if(counter_write == 12 )
|
|
{
|
|
|
|
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[8];
|
|
c = c << 8;
|
|
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[9];
|
|
c = c << 8;
|
|
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[10];
|
|
c = c << 8;
|
|
c = c | TEXT_FIPS_NOT_DATATYPE_DERIVATED[11];
|
|
v_ecb.value.integer = c;
|
|
|
|
}else if(counter_write == 13 )
|
|
{
|
|
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[12];
|
|
d = d << 8;
|
|
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[13];
|
|
d = d << 8;
|
|
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[14];
|
|
d = d << 8;
|
|
d = d | TEXT_FIPS_NOT_DATATYPE_DERIVATED[15];
|
|
v_ecb.value.integer = d;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
}else if(FIPS_ENABLE == RANDOM_DATA)
|
}else if(FIPS_ENABLE == RANDOM_DATA)
|
{
|
{
|
v_ecb.value.integer = data_in(rd);
|
v_ecb.value.integer = data_in(rd);
|
}
|
}
|