Line 241... |
Line 241... |
|
|
//ENABLE CR
|
//ENABLE CR
|
if(counter_write == 9)
|
if(counter_write == 9)
|
{
|
{
|
|
|
v_ecb.value.integer = vector_address[counter_write];
|
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 = 537;
|
|
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;
|
|
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
|
|
|
|
v_ecb.value.integer = 539;
|
|
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
|
|
|
|
}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);
|
vpi_put_value(PADDR, &v_ecb, NULL, vpiNoDelay);
|
|
|
t_ecb.type = vpiScaledRealTime;
|
v_ecb.value.integer = 541;
|
t_ecb.real = 0;
|
|
v_ecb.format=vpiIntVal;
|
|
v_ecb.value.integer = 537;//data_in(rd);
|
|
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 = 543;
|
|
vpi_put_value(PWDATA, &v_ecb, &t_ecb, vpiTransportDelay);
|
|
}
|
|
|
}
|
}
|
|
|
//WRITE DINR
|
//WRITE DINR
|
if(counter_write > 9 && counter_write < 14) //WRITE DINR
|
if(counter_write > 9 && counter_write < 14) //WRITE DINR
|
{
|
{
|
Line 263... |
Line 287... |
|
|
|
|
if(FIPS_ENABLE == FIPS)
|
if(FIPS_ENABLE == FIPS)
|
{
|
{
|
|
|
|
if(DATATYPE == TYPE_00)
|
|
{
|
|
|
if(counter_write == 10)
|
if(counter_write == 10)
|
{
|
{
|
a = a | TEXT_FIPS_DERIVATED[0];
|
a = a | TEXT_FIPS_DERIVATED[0];
|
a = a << 8;
|
a = a << 8;
|
a = a | TEXT_FIPS_DERIVATED[1];
|
a = a | TEXT_FIPS_DERIVATED[1];
|
Line 310... |
Line 337... |
d = d | TEXT_FIPS_DERIVATED[15];
|
d = d | TEXT_FIPS_DERIVATED[15];
|
v_ecb.value.integer = d;
|
v_ecb.value.integer = d;
|
|
|
}
|
}
|
|
|
|
}else if(DATATYPE == TYPE_01)
|
|
{
|
|
|
|
|
|
if(counter_write == 10)
|
|
{
|
|
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[0];
|
|
a = a << 8;
|
|
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[1];
|
|
a = a << 8;
|
|
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[2];
|
|
a = a << 8;
|
|
a = a | TEXT_FIPS_DATATYPE_T01_DERIVATED[3];
|
|
v_ecb.value.integer = a;
|
|
|
|
}else if(counter_write == 11)
|
|
{
|
|
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[4];
|
|
b = b << 8;
|
|
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[5];
|
|
b = b << 8;
|
|
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[6];
|
|
b = b << 8;
|
|
b = b | TEXT_FIPS_DATATYPE_T01_DERIVATED[7];
|
|
v_ecb.value.integer = b;
|
|
|
|
}else if(counter_write == 12 )
|
|
{
|
|
|
|
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[8];
|
|
c = c << 8;
|
|
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[9];
|
|
c = c << 8;
|
|
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[10];
|
|
c = c << 8;
|
|
c = c | TEXT_FIPS_DATATYPE_T01_DERIVATED[11];
|
|
v_ecb.value.integer = c;
|
|
|
|
}else if(counter_write == 13 )
|
|
{
|
|
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[12];
|
|
d = d << 8;
|
|
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[13];
|
|
d = d << 8;
|
|
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[14];
|
|
d = d << 8;
|
|
d = d | TEXT_FIPS_DATATYPE_T01_DERIVATED[15];
|
|
v_ecb.value.integer = d;
|
|
|
|
}
|
|
|
|
}else if(DATATYPE == TYPE_02)
|
|
{
|
|
if(counter_write == 10)
|
|
{
|
|
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[0];
|
|
a = a << 8;
|
|
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[1];
|
|
a = a << 8;
|
|
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[2];
|
|
a = a << 8;
|
|
a = a | TEXT_FIPS_DATATYPE_T02_DERIVATED[3];
|
|
v_ecb.value.integer = a;
|
|
|
|
}else if(counter_write == 11)
|
|
{
|
|
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[4];
|
|
b = b << 8;
|
|
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[5];
|
|
b = b << 8;
|
|
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[6];
|
|
b = b << 8;
|
|
b = b | TEXT_FIPS_DATATYPE_T02_DERIVATED[7];
|
|
v_ecb.value.integer = b;
|
|
|
|
}else if(counter_write == 12 )
|
|
{
|
|
|
|
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[8];
|
|
c = c << 8;
|
|
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[9];
|
|
c = c << 8;
|
|
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[10];
|
|
c = c << 8;
|
|
c = c | TEXT_FIPS_DATATYPE_T02_DERIVATED[11];
|
|
v_ecb.value.integer = c;
|
|
|
|
}else if(counter_write == 13 )
|
|
{
|
|
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[12];
|
|
d = d << 8;
|
|
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[13];
|
|
d = d << 8;
|
|
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[14];
|
|
d = d << 8;
|
|
d = d | TEXT_FIPS_DATATYPE_T02_DERIVATED[15];
|
|
v_ecb.value.integer = d;
|
|
|
|
}
|
|
|
|
|
|
|
|
}else if(DATATYPE == TYPE_03)
|
|
{
|
|
if(counter_write == 10)
|
|
{
|
|
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[0];
|
|
a = a << 8;
|
|
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[1];
|
|
a = a << 8;
|
|
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[2];
|
|
a = a << 8;
|
|
a = a | TEXT_FIPS_DATATYPE_T03_DERIVATED[3];
|
|
v_ecb.value.integer = a;
|
|
|
|
}else if(counter_write == 11)
|
|
{
|
|
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[4];
|
|
b = b << 8;
|
|
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[5];
|
|
b = b << 8;
|
|
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[6];
|
|
b = b << 8;
|
|
b = b | TEXT_FIPS_DATATYPE_T03_DERIVATED[7];
|
|
v_ecb.value.integer = b;
|
|
|
|
}else if(counter_write == 12 )
|
|
{
|
|
|
|
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[8];
|
|
c = c << 8;
|
|
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[9];
|
|
c = c << 8;
|
|
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[10];
|
|
c = c << 8;
|
|
c = c | TEXT_FIPS_DATATYPE_T03_DERIVATED[11];
|
|
v_ecb.value.integer = c;
|
|
|
|
}else if(counter_write == 13 )
|
|
{
|
|
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[12];
|
|
d = d << 8;
|
|
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[13];
|
|
d = d << 8;
|
|
d = d | TEXT_FIPS_DATATYPE_T03_DERIVATED[14];
|
|
d = d << 8;
|
|
d = d | TEXT_FIPS_DATATYPE_T03_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);
|
}
|
}
|