//--------------------------------------------------------------------
// Created by Microsemi SmartDesign Thu Mar 25 18:21:09 2021
// Parameters for COREABC
//--------------------------------------------------------------------


parameter ABCCODE = "
$WelcomeMessage
    
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    NOP
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'E'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'n'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    
   
    WAIT UNTIL INPUT0

    APBWRT DAT8 1 0x0 'Y'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'u'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'C'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'h'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'c'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e' 
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 '1'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 46
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'D'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'v'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'c'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'S'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'   

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'a'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'l'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32


    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'N'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'u'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'm'   

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'b'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'

 
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 '2'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 46
    
    
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'D'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'g'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'n'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'V'   
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'n'
    
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 '3'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 46
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'N'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'V'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'M'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 '0'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'D'   
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'g'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    Jump $UARTINPUT
/////////////////////////////////////////   
$UARTINPUT
    
    WAIT UNTIL INPUT2
    APBREAD 1 0x4
    APBWRT ACC 1 0x0 
    CMP DAT 0x31
    Jump IF Zero $Pattern1 
    CMP DAT 0x32
    Jump IF Zero $Pattern2
    CMP DAT 0x33
    Jump IF Zero $Pattern3
    Jump $WelcomeMessage

$Pattern1
    
//DSN---------------------------------
    APBWRT DAT8 0 0x0000 0x03        
   
    APBWRT DAT8 0 0x0000 0x00
    
    
    WAIT UNTIL INPUT3

    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'D'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'S'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'N'
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'v'   
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'a'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'l'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'u'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
   
//Reading DSN  
    APBREAD 0 0x9044
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0

    APBREAD 0 0x9040
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    NOP
    

    APBREAD 0 0x903C
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    
    APBREAD 0 0x9038
    
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    NOP
    
    APBREAD 0 0x9034
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0


    APBREAD 0 0x9030

    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    NOP
    
    APBREAD 0 0x902C
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    
    APBREAD 0 0x9028

    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    NOP
    
    APBREAD 0 0x9024
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
 
    APBREAD 0 0x9020
    
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    NOP
    
    APBREAD 0 0x901C
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    
    APBREAD 0 0x9018

    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    NOP
    
    APBREAD 0 0x9014
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    
    APBREAD 0 0x9010

    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    NOP
    
    
    APBREAD 0 0x900C
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    
    APBREAD 0 0x9008

    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0    
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    NOP

    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    
    NOP
    NOP
    NOP
    Jump $WelcomeMessage
    
    
$Pattern2
//design version
    APBWRT DAT8 0 0x0000 0x05
 
    APBWRT DAT8 0 0x0000 0x00
    
    WAIT UNTIL INPUT3

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'D'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'g'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'n'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'v'   
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'r'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'n'
    
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    NOP
 //Reading Design Version   
    APBREAD 0 0x9004
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    
     APBREAD 0 0x9000

    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    NOP
    

    NOP
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    
    NOP
    NOP
    NOP
    Jump $WelcomeMessage
    
    

    
$Pattern3
    
//envm digest
    
    APBWRT DAT8 0 0x0000 0x09
   
    APBWRT DAT8 0 0x0000 0x00
   
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    WAIT UNTIL INPUT3
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'D'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'i'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'g'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 't'
    

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 32
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'R'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'p'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'o'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'n'

    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 's'
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 'e'
    
   
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13

//reading digest response   
    APBREAD 0 0x9048
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    SHR0
    WAIT UNTIL INPUT0
    APBWRT ACC 1 0x0
    NOP 
    
 
    
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 10
    WAIT UNTIL INPUT0
    APBWRT DAT8 1 0x0 13
    NOP
    NOP
    NOP
    Jump $WelcomeMessage
    
    
    HALT 
    
    ";
parameter ACT_CALIBRATIONDATA = 1;
parameter APB_AWIDTH = 16;
parameter APB_DWIDTH = 32;
parameter APB_SDEPTH = 16;
parameter CODEHEXDUMP = "";
parameter CODEHEXDUMP2 = "";
parameter DEBUG = 1;
parameter EN_ACM = 0;
parameter EN_ADD = 1;
parameter EN_ALURAM = 0;
parameter EN_AND = 1;
parameter EN_CALL = 1;
parameter EN_DATAM = 2;
parameter EN_INC = 1;
parameter EN_INDIRECT = 0;
parameter EN_INT = 0;
parameter EN_IOREAD = 1;
parameter EN_IOWRT = 1;
parameter EN_MULT = 0;
parameter EN_OR = 1;
parameter EN_PUSH = 1;
parameter EN_RAM = 1;
parameter EN_RAM_ECC = 0;
parameter EN_SHL = 1;
parameter EN_SHR = 1;
parameter EN_XOR = 1;
parameter FAMILY = 24;
parameter HDL_license = "U";
parameter ICWIDTH = 11;
parameter IFWIDTH = 4;
parameter IIWIDTH = 4;
parameter IMEM_APB_ACCESS = 0;
parameter INITWIDTH = 11;
parameter INSMODE = 0;
parameter IOWIDTH = 1;
parameter ISRADDR = 1;
parameter MAX_NVMDWIDTH = 32;
parameter STWIDTH = 8;
parameter TESTBENCH = "User";
parameter TESTMODE = 0;
parameter UNIQ_STRING = "UART_top_COREABC_0";
parameter UNIQ_STRING_LENGTH = 18;
parameter VERILOGCODE = "";
parameter VERILOGVARS = "";
parameter VHDLCODE = "";
parameter VHDLVARS = "";
parameter ZRWIDTH = 0;
