Quickref of LCA structures and functions
Version 6.17

/*+************************************************************************
 * Lcadata:  This is the top level structure of an LCA data structure.
 * The data manager cell body pointer points to this structure.
 ************************************************************************-*/
PUBLIC struct lcadata_struct
{
  Dmcell *dmcell;             /* points back to data manager cell (READ-ONLY)*/
  Char *part;                      /* part type */
  Int4 version;                    /* version number */
  DTABLE(Char) *comment;           /* table of file comments */
  DTABLE(Char) *system;            /* table of System statements */
  DTABLE(Lcanet) *nets;            /* table of nets */
  DTABLE(Lcablk) *blks;            /* table of blocks */
  HASHTABLE(Lcanet) *nethash;      /* hash table for nets */
  HASHTABLE(Lcablk) *blkhash;      /* hash table for blocks */
  HASHTABLE(Lcapin) *pinhash;      /* hash table for pins */
  Addr value;                      /* user-defined value */
  Heap heap;                       /* which heap in memory is used (READ-ONLY)*/
  Int4 speed;                      /* speed grade */
};

/*+************************************************************************
 * Lcapin:  Struct for LCA Pin data.  A pin can be a CLB, IOB, TBUF, BSCAN,
 * STARTUP, decoder, pullup, or special-corner-logic pin.
 ************************************************************************-*/
PUBLIC struct lcapin_struct
{
  Char *name;       /* name of pin (READ-ONLY)*/
  Lcanet *net;      /* ptr back to Lcanet this pin is on (READ-ONLY)*/
  Lcablk *blk;      /* ptr back to Lcablk this pin is on (READ-ONLY)*/
  Addr value;       /* user-defined value */
  Int4 delay;       /* delay for this pin, mult'd by 10 */
  Int4 netindex;    /* index into the Lcapin DTABLE of Lcanet (READ-ONLY)*/
  Int4 blkindex;    /* index into the Lcapin DTABLE of Lcablk (READ-ONLY)*/
};

/*+************************************************************************
 * Lcapip:  Struct for LCA Pip data.  A Pip can be a switch matrix pair,
 * or made up of a long-line, general-purpose interconnect, or a pin.
 ************************************************************************-*/
PUBLIC struct lcapip_struct
{
  Lcanet *net;      /* pointer to net this pip is on (READ-ONLY)*/
  Addr value;       /* user-defined value */
  Char *part1;      /* first half of pip (READ-ONLY)*/
  Char *part2;      /* second half of pip (READ-ONLY)*/
  Lcapiptype type;  /* type:  pip or switch matrix (READ-ONLY)*/
  Char *dir;        /* directionality of part2; S or L (READ-ONLY)*/
  Int4 num;         /* index into the Lcapip DTABLE of Lcanet (READ-ONLY)*/
};

/*+************************************************************************
 * Lcablk:  Struct for LCA Block data.  All data related to a block is
 * found here.  A block can be a CLB, IOB, TBUF, BSCAN, STARTUP, decoder,
 * pullup, or special-corner logic.  Only the first 6 block types listed are
 * written to a LCA file in the Editblk line.
 ************************************************************************-*/
PUBLIC struct lcablk_struct
{
  Char *name;             /* block name */
  Char *location;         /* block coordinates (READ-ONLY)*/
  Lcadata *lcadata;       /* pointer back to Lcadata structure (READ-ONLY)*/
  DTABLE(Char) *config;   /* table of config line data */
  DTABLE(Lcapin) *pins;   /* table of pins on this block */
  Addr value;             /* user-defined value */
  Lcanet *f_pad_intnet;   /* ptr to net of F func gen (for CLB) or PAD (IOB) */
  Lcanet *g_intnet;       /* ptr to net of G function generator */
  Lcanet *h_intnet;       /* ptr to net of H function generator */
  Lcanet *m_intnet;       /* ptr to net of M Mux */
  Lcanet *qy_intnet;      /* ptr to net of QY feedback */
  Lcanet *qx_intnet;      /* ptr to net of QX feedback */
  Char *comment;          /* cmtblk comment */
  Lcablktype type;        /* type of block (READ-ONLY)*/
  Int4 colorid;           /* color id for Colorblk line */
  Int4 num;               /* index into blks dtable for this blk (READ-ONLY) */
};

/*+************************************************************************
 * Lcanet:  Struct for LCA Net data.  All data related to a net is found here.
 ************************************************************************-*/
PUBLIC struct lcanet_struct
{
  Char *name;                /* net name (READ-ONLY)*/
  DTABLE(Lcapin) *pins;      /* table of pins on this net */
  DTABLE(Lcapip) *pips;      /* table of pips on this net */
  DTABLE(Lcanet) *pathnets;  /* table of nets defined in Definepath line */
  DTABLE(Lcanet) *neteqs;    /* table of NETEQ equiv nets for this root net */
  Addr value;                /* user-defined value */
  Lcadata *lcadata;          /* ptr back to Lcadata structure (READ-ONLY)*/
  Lcanet *defpath;           /* ptr to Lcanet that is original Definepath net */
  Lcanet *eqv_root;          /* ptr to Lcanet that is NETEQ root net */
  Char *flagnet;             /* flagnet parameter */
  Int4 num;               /* index into nets dtable for this net (READ-ONLY)*/
  Int4 colorid;              /* color id from Colornet line */
};


/*+*********************************************************************
*                LCA Data Manipulation Functions                       *
*********************************************************************-*/

/**************   Creating Memory Structures  **************************/
Lcadata  *lca_new_data ( /* dmcell */ )
Lcanet   *lca_add_net  ( /* lcadata,netname */ )
Lcablk   *lca_add_blk  ( /* lcadata,block,blkname */ )
Lcapin   *lca_add_pin  ( /* lcanet,lcablk,pinname*/ )
Lcapip   *lca_add_pip  ( /* lcanet,part1,part2,type,dir*/ )

Lcapip   *lca_find_pip ( /* lcanet,part1,part2 */ )

/*****************  Finding Data **************************/
Lcablk *lca_find_blk            ( /* lcadata,block /* )
Lcapin *lca_find_pin            ( /* lcadata,pinname /* )
Lcapip *lca_find_pip            ( /* net,part1,part2 /* )
Lcanet *lca_find_net            ( /* lcadata,netname /* )

Char   *lca_get_parttype        ( /* lcadata /* )
Int4    lca_get_version         ( /* lcadata /* )
Int4    lca_get_speed           ( /* lcadata /* )

Char   *lca_net_get_name        ( /* net /* )
Lcanet *lca_net_get_defpath     ( /* net /* )
Char   *lca_net_get_flagnet     ( /* net /* )
Int4    lca_net_get_color       ( /* net /* )
Lcanet *lca_next_path_specifier ( /* lcadata,net */ )

Lcablktype  lca_blk_get_type    ( /* blk /* )
Char       *lca_blk_get_name        ( /* blk /* )
Char       *lca_blk_get_comment     ( /* blk /* )
Int4        lca_blk_get_color       ( /* blk /* )
Char       *lca_blk_get_config      ( /* blk,tag /* )
Char       *lca_blk_get_base        ( /* blk /* )
Char       *lca_blk_get_cfgcarry    ( /* blk /* )
Char       *lca_blk_get_equate_f    ( /* blk /* )
Char       *lca_blk_get_equate_g    ( /* blk /* )
Char       *lca_blk_get_equate_h    ( /* blk /* )
Char       *lca_blk_get_ramconfig_f ( /* blk /* )
Char       *lca_blk_get_ramconfig_g ( /* blk /* )
Char       *lca_blk_get_ramconfig_fg( /* blk /* )
Lcanet     *lca_blk_get_intnet      ( /* blk,fg */ )
Lcanet     *lca_blk_get_intnet_f    ( /* blk */ )
Lcanet     *lca_blk_get_intnet_g    ( /* blk */ )
Lcanet     *lca_blk_get_intnet_h    ( /* blk */ )
Lcanet     *lca_blk_get_intnet_pad  ( /* blk */ )
Lcanet     *lca_blk_get_intnet_m    ( /* blk */ )
Lcanet     *lca_blk_get_intnet_qy   ( /* blk */ )
Lcanet     *lca_blk_get_intnet_qx   ( /* blk */ )

Flt8    lca_pin_get_delay       ( /* pin /* )
Lcanet *lca_pin_get_net         ( /* pinname /* )

Int4    lca_pip_get_dir         ( /* pip /* )

/*****************  Setting Data **************************/
Bool lca_set_parttype         ( /* lcadata,part */ )
Bool lca_set_version          ( /* lcadata,version */ )
Bool lca_set_speed            ( /* lcadata,speed */ )
Bool lca_set_comment          ( /* lcadata,comment */ )
Bool lca_set_system           ( /* lcadata,line */ )

Bool lca_pin_set_delay        ( /* lcadata,pin,delay */ )

Bool    lca_net_set_flagnet      ( /* net,flagparam */ )
Bool    lca_net_set_color        ( /* net,color */ )
Bool    lca_net_set_alias        ( /* net,alias */ )
Lcanet *lca_net_set_defpath      ( /* net,defpath /* )
Bool    lca_net_set_pathnet      ( /* net,pathname /* )

Bool lca_blk_set_comment      ( /* blk,comment */ )
Bool lca_blk_set_base         ( /* blk,base */ )
Bool lca_blk_set_name         ( /* blk,blkname */ )
Bool lca_blk_set_config       ( /* blk,tag,data */ )
Bool lca_blk_set_equate_f     ( /* blk,equate_line */ )
Bool lca_blk_set_equate_g     ( /* blk,equate_line */ )
Bool lca_blk_set_equate_h     ( /* blk,equate_line */ )
Bool lca_blk_set_ramconfig_f  ( /* blk,ramconfig_line */ )
Bool lca_blk_set_ramconfig_g  ( /* blk,ramconfig_line */ )
Bool lca_blk_set_ramconfig_fg ( /* blk,ramconfig_line */ )
Bool lca_blk_set_cfgcarry     ( /* blk,cfgcarry_line */ )
Bool lca_blk_set_blkcmt       ( /* blk,comment */ )
Bool lca_blk_set_color        ( /* blk,color */ )
Bool lca_blk_set_intnet       ( /* blk,fg,netname */ )
Bool lca_blk_set_intnet_f     ( /* blk,netname */ )
Bool lca_blk_set_intnet_g     ( /* blk,netname */ )
Bool lca_blk_set_intnet_h     ( /* blk,netname */ )
Bool lca_blk_set_intnet_pad   ( /* blk,netname */ )
Bool lca_blk_set_intnet_m     ( /* blk,netname */ )
Bool lca_blk_set_intnet_qy    ( /* blk,netname */ )
Bool lca_blk_set_intnet_qx    ( /* blk,netname */ )

/****************   NETEQ Data Functions   **************************/
Int4    lca_sys_neteq_init    ( /* lcadata,errstr */ );
Proc    lca_sys_neteq_clear   ( /* lcadata */ );
Lcanet *lca_net_get_eqv_root  ( /* net */ );


/****************   FGGUIDE Data Functions   **************************/
Proc    lca_sys_start_fgg_search( /* lcadata */ );
String *lca_sys_get_next_fgg    ( /* lcadata */ );
Proc    lca_sys_end_fgg_search  ( /*  */ );
Proc    lca_sys_start_fgg_set   ( /* lcadata */ );
Bool    lca_sys_set_next_fgg    ( /* lcadata,fgg */ );
Bool    lca_sys_format_fgg      ( /* fptr,str,lcadata */ );
Proc    lca_sys_end_fgg_set     ( /*  */ );
Proc    lca_sys_remove_all_fgg  ( /* lcadata */ );
Proc    lca_sys_compress        ( /* index,value */ );

/****************   Utility ********************************/
Int4       lca_get_part_family    ( /* lcadata */ )

Lcapip    *lca_move_pip           ( /* newnet,pip */ )

Char      *lca_pin_block_id       ( /* pinname */ )
Lcapin    *lca_move_pin           ( /* newnet,pin */ )

Lcablktype lca_blk_type_id        ( /* lcadata,block */ )
Bool       lca_blk_get_row_col    ( /* blk,max_row,max_col,row,col */ )
Char      *lca_blk_config_line    ( /* blk */ )
Char      *lca_blk_parse_tag      ( /* blk,tag,index */ )
Int4       lca_blk_tag_index      ( /* blk,tag */ )
Bool       lca_blk_is_clb         ( /* blk */ )
Bool       lca_blk_is_iob         ( /* blk */ )
Bool       lca_blk_is_bscan       ( /* blk */ )
Bool       lca_blk_is_startup     ( /* blk */ )
Bool       lca_blk_is_tbuf        ( /* blk */ )
Bool       lca_blk_is_decoder     ( /* blk */ )
Bool       lca_blk_is_pullup      ( /* blk */ )
Bool       lca_blk_is_spec_corner ( /* blk */ )

Bool       lca_net_check_name     ( /* netname */ )

/*********************  Non-LCA Config Users **********************/
DTABLE(Char) *lca_init_config   ( /* heap,blktype */ )
Int4          lca_parse_config  ( /* heap,tokenset,blktype,table,tag */ )
Int4          lca_tag_index     ( /* blktype,tag */ )
Char         *lca_parse_tag     ( /* config_table,type,tag,index */ )
Bool          lca_check_tag_values( /* blktype,table,tag_index,vld_err,stx_err */ )

Bool lca_set_config          ( /* heap,blktype,table,tag,data */ )
Bool lca_set_base            ( /* heap,blktype,table,base */ )
Bool lca_set_equate_f        ( /* heap,blktype,table,equate_line */ )
Bool lca_set_equate_g        ( /* heap,blktype,table,equate_line */ )
Bool lca_set_equate_h        ( /* heap,blktype,table,equate_line */ )
Bool lca_set_ramconfig_f     ( /* heap,blktype,table,ramconfig_line */ )
Bool lca_set_ramconfig_g     ( /* heap,blktype,table,ramconfig_line */ )
Bool lca_set_ramconfig_fg    ( /* heap,blktype,table,ramconfig_line */ ) 
Bool lca_set_cfgcarry        ( /* heap,blktype,table,cfgcarry_line */ )

Bool lca_remove_config_all   ( /* heap,table */ )
Bool lca_clear_config        ( /* heap,table,tag */ )

Char *lca_build_config_line  ( /* blktype,table */ )

Char *lca_get_config         ( /* blktype,table,tag */ )
Char *lca_get_base           ( /* blktype,table*/ )
Char *lca_get_equate_f       ( /* blktype,table*/ )
Char *lca_get_equate_g       ( /* blktype,table*/ )
Char *lca_get_equate_h       ( /* blktype,table*/ )
Char *lca_get_ramconfig_f    ( /* blktype,table*/ )
Char *lca_get_ramconfig_g    ( /* blktype,table*/ )
Char *lca_get_ramconfig_fg   ( /* blktype,table*/ )
Char *lca_get_cfgcarry       ( /* blktype,table*/ )

/****************   Removing Data **************************/
Bool lca_remove_comment          ( /* lcadata,comment */ )
Bool lca_remove_comment_all      ( /* lcadata,comment */ )
Bool lca_remove_system           ( /* lcadata,line */ )
Bool lca_remove_system_all       ( /* lcadata,line */ )
Bool lca_remove_pin              ( /* lcadata,pin */ )
Bool lca_remove_pin_only         ( /* lcadata,pin */ )
Bool lca_remove_pin_w_blk        ( /* lcadata,pin */ )
Bool lca_remove_pin_w_net        ( /* lcadata,pin */ )
Bool lca_remove_net              ( /* net */ )
Bool lca_remove_net_only         ( /* net */ )
Bool lca_remove_blk              ( /* blk */ )
Bool lca_remove_blk_only         ( /* blk */ )

Bool lca_net_remove_alias        ( /* net,alias */ )
Bool lca_net_remove_alias_all    ( /* net,alias */ )
Bool lca_net_remove_pip          ( /* net,pip */ )
Bool lca_net_remove_pathnet      ( /* net,pathnet */ )
Bool lca_net_remove_pathnet_all  ( /* net */ )

Bool lca_blk_clear_config        ( /* blk,tag */ )
Bool lca_blk_remove_config_all   ( /* blk */ )
Proc lca_blk_remove_intnet       ( /* blk,fg */ )
Proc lca_blk_remove_intnet_f     ( /* blk */ )
Proc lca_blk_remove_intnet_g     ( /* blk */ )
Proc lca_blk_remove_intnet_h     ( /* blk */ )
Proc lca_blk_remove_intnet_pad   ( /* blk */ )
Proc lca_blk_remove_intnet_m     ( /* blk */ )
Proc lca_blk_remove_intnet_qy    ( /* blk */ )
Proc lca_blk_remove_intnet_qx    ( /* blk */ )

/**********   Looping Macros **************/
LCA_COMMENTS     (lcadata,index,cmt)    - loop thru all comments 

LCA_SYSTEMS      (lcadata,index,sys)    - loop thru all System statements 

LCA_NETS         (lcadata,index,net)    - loop thru all nets 
LCA_NET_PINS     (net,index,pin)        - loop thru all net pins 
LCA_NET_PIPS     (net,index,pip)        - loop thru all net pips 
LCA_NET_PATHNETS (net,index,pathnet)    - loop thru all net pathnets 
LCA_NET_NETEQS   (net,index,eqv_net)    - loop thru all net neteqs 

LCA_PATH_SPECIFIERS (lcadata,net)       - loop thru all path specifiers 

LCA_NETEQ_ROOTS     (lcadata,net)       - loop thru all NETEQ root nets 

LCA_BLKS         (lcadata,index,blk)    - loop thru all blks 
LCA_BLK_TAG_DATA (blk,tag,index,value)  - loop thru all blk config data 
LCA_TAG_DATA     (config_table,type,tag,index,value) - loop thru all tag values 
LCA_BLK_PINS     (blk,index,pin)        - loop thru all blk pins 
