Subversion Repositories ngs

Rev

Blame | Last modification | View Log | Download | RSS feed | ?url?

  1. #ifndef __BSDL_H__
  2. #define __BSDL_H__
  3.  
  4. /*
  5.  *  INFO:
  6.  *     bsdl.cpp (C) 2002  Dr. Yuri Klimets (www.jtag.tk, jtagtools.sf.net)  
  7.  *     E-mail: klimets@jtag.tk
  8.  *     Rev. 1.3 - 12.10.2002
  9.  *  
  10.  *  
  11.  *  DESCRIPTION:
  12.  *     Contains definitions of functions and data structures for BSDL parser
  13.  *
  14.  *
  15.  *  DISCLAIMER:
  16.  *     This program is free software; you can redistribute it and/or modify
  17.  *     it under the terms of the GNU General Public License as published by
  18.  *     the Free Software Foundation; either version 2 of the License, or
  19.  *     (at your option) any later version.
  20.  *
  21.  *     This program is distributed in the hope that it will be useful,
  22.  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
  23.  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  24.  *     GNU General Public License for more details.
  25.  *
  26.  *     You should have received a copy of the GNU General Public License
  27.  *     along with this program; if not, write to the Free Software
  28.  *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  29. */  
  30.  
  31. #include <stdio.h>
  32.  
  33. #define DWORD unsigned long
  34.  
  35. //----------------------------------------------------------
  36. struct PINS {
  37.      char * name;    // pin name
  38.          char * altname;// alternative name
  39.      DWORD id_pins; // pin number
  40.      int   input;   // bit for pin input    -\
  41.      int   output;  // bit for pin output    |- absent if -1
  42.      int   control; // bit for pin control  -/
  43.      int   vOUT;    // value for output
  44.      char  prev_i;  // previous value of input
  45.      char  prev_o;  // previous value of output value
  46.      char  prev_c;  // previous value of control
  47.      PINS* next;
  48. };
  49.  
  50. struct BS {
  51.      char* name;    // the name of JTAG-device
  52.      DWORD id_bs;   // device id (for interconnect)
  53.      char* file;    // file name with device description
  54.      int   IRlen;   // the length of Instruction Register
  55.      int   DRlen;   // the length of Boundary Scan Register
  56.      int   IDlen;   // the length of Device ID  Register
  57.      char* BYPASS;
  58.          char* EXTEST;
  59.      char* SAMPLE;  // the code of command SAMPLE
  60.      char* IDCODE;  // the code of command IDCODE
  61.      char* ID;      // device ID Code
  62.      int   PINnum;  // the number of devices pins
  63.      PINS* pins;    // pointer to the pins structure
  64.      BS*   next;    // pointer to the next device structure
  65. };
  66.  
  67.  
  68. extern struct PINS* Pbegin;
  69. extern struct BS*   BSbegin;
  70.  
  71. //----------------------------------------------------------
  72.  
  73. // extern word;
  74. extern void  printBS(FILE *);
  75. extern DWORD pins2id(DWORD, char *);
  76. extern int   getfwdint(char *, char);
  77.  
  78. extern PINS* addPIN(char *);
  79. extern PINS* findPIN(char *);
  80. extern PINS* findPINx(char *);
  81. extern void  delPINSitem(PINS *);
  82. extern void  addBSitem();
  83. extern void  delBSitem(BS *);
  84. extern void  delBSall();
  85. extern void  PINanalysis(char *);
  86.  
  87. extern void addPINalias(char *,char *);
  88. extern PINS * findPINalias(char *);
  89.  
  90. extern BS*   readBSD(char *, int, DWORD);
  91.  
  92. #endif