blob: f517b010c166903f2cbc487c2d1e3996b6814d3d (
plain)
| 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
 | Copyright (c) 2005 Juan Pablo D. Borgna <jpborgna en inti gov ar>
Copyright (c) 2006-2007 Salvador E. Tropea <salvador en inti gov ar>
Copyright (c) 2005-2007 Instituto Nacional de Tecnología Industrial
Commands and blocks:
                    The template files have block commands and operation
                    commands. The block commands start with two substract
                    signs "--" and the operation are betwin dollar signs "$".
                    The block commands mark the excecution of a block and the
                    end of the block must be identifyed with the instruction
                    "--END".
Internal variables:
                   The next internal variables are provided wich can be used
                   indicating their name betwin dollars signs "$" or modified
                   if a value is assigned using parentesis signs.
                   Ex.: $ADDRESS(0x00)$ asigns this variable the value 0x0000.
$ADDRESS$ :
           Accumulator useful at the time of incrementing a memory address.
           
$STEP$    :
           Value on wich $ADDRESS$ variable will be incremented.
$BSIZEB$  :
           Amount of bytes of the bitstream file.
$BSIZEB2$ :
           2 * amount of bytes of the bitstream file.
$BSIZE$   :
           Amount of bits of the bitstream file.
           Note: BSIZE an STEP are related. BSIZE is the size of the cache
           used to store the data before flashing the device. Each memory
           address contains some bits that's a word, the STEP is the size of
           the cache in words. So BSIZE=STEP*word_size.
           For the XC18V: 32*64=2048 o 32*128=4096.
$MSIZE$   :
           Taken from the msize field from the device definition in the
           DEVICES file.
           It contains the last memory position of a device with memory.
$ID$      :
           Taken from the id field from the device definition in the DEVICES
           file.
           It contains the IDCODE of the selected device.
$IDMASK$  :
           Taken from the idmask field from the device definition in the
           DEVICE file.
           It contains the mask wich be used in the comprobation of the IDCODE
Block commands:
--LITERAL START :
                 It indicate that in the output file must be copied the content
                 of this block until the end is found "as is".
                 If an operational command is found inside it is excecuted.
--REPEAT START :
                It indicate that this block will be repeated until the end of
                the bitfile is reached.
                This block must have inside some operational command wich
                reads information from the input bitfile, if not, the end of
                this will never be reached and the progran will keep
                repeating this block until there is no more disk space.
                With each block iteration the variable $ADDRESS$ is
                incremented by $STEP$.
--REPEAT UNTIL value :
                      It indicates that this block will be repeated until the
                      variable $ADDRESS$ reach the value passed as parameter.
                      With each block iteration the variable $ADDRESS$ is
                      incremented by $STEP$.
                      The value passwd as parameter must be $STEP$ multiplo,
                      or the exit condition will never be reached and the
                      program will keep repeating this block until there is
                      no more disk space.
                      Instead of value you can use a variable:
                      Ej.: --REPEAT UNTIL MSIZE
--END :
       It indicates the end of a LITERAL, REPEAT or REPEAT UNTIL block.
Opeation commands:
                  The operation commands may recive as an argment the name of
                  a variable instead of a constant:
                      Ej.: $FILL(0xFF,BSIZE)$
$DATA(ndatabytes)$ :
                    Writes in the output file a ndatabytes amount of bytes
                    from the input bitfile expressed in hex.
$DATA_INV(ndatabytes)$ :
                        Writes in the output fila a ndatabytes amount of bytes
                        from the input bitfile inverting the order, expressed
                        in hex.
$FILL(VAL,TIMES)$ :
                   Writes TIMES times the value VAL expressed in hex in the
                   output file.
$REWIND$ :
          Rewinds the bitfile to the first stream byte so it can be used in a
          new block.
$CUTLINES(n):
             Using 0 stops cutting long lines, 1 starts cutting again.
             Other values: reserved.
          
 |