Skip to content

Commit

Permalink
[minor] -docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Neill committed Mar 3, 2011
1 parent f928016 commit f6b9336
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions doc/raw.txt
@@ -1,31 +1,33 @@
The raw format of the pulseblaster executable is a sequence of 10-byte "VLIW" instructions.
(These are normally generated by the separate tool pb_asm, part of pb_utils).
The VLIW format (see vliw.txt) is a simple representation of an ideal pulseblaster. In order to actually program it,
we need to convert each VLIW instruction into a sequence of 10 bytes, which are actually written to the device.
This final stage would generate a .bin file; pb_asm converts VLIW to BIN; pb_prog goes direct from VLIW to the hardware.

Consider the following VLIW instruction:
This is the process:

(1) Consider the following VLIW instruction:

#OUTPUT OPCODE ARG LENGTH
0xffeedd CALL 0x88776 0xccbbaa99

The assembler, pb_asm does the following:

- Opcodes are converted from strings to numbers (as defined in pulseblaster.h)
[In this case, CALL = 0x4 ]

- Lengths are corrected, eg subtraction of PB_INTERNAL_LATENCY.
[In this example, length becomes 0xccbbaa96 ]
(2) This is read in by pb_prog, tokenised by pb_parse_sourceline() and then merged by pb_make_vliw() in src/pb-functions.inc

- The VLIW is is split up into 10 bytes:
- Opcodes are converted from strings to numbers (as defined in pulseblaster.h)
[In the example, CALL = 0x4 ]
- If ARG is '-', it is converted to 0.
- Offsets are corrected, eg subtraction of PB_INTERNAL_LATENCY.
[In this example, length becomes 0xccbbaa96 ]
- It is split up into 10 bytes:


The bytes are these:
(3) The bytes are these:

3 bytes of output
2 1/2 bytes for arg
1/2 byte for opcode
4 bytes for the delay.


Thus, we actually get the following series of writes, in this order
(4) Thus, we actually get the following series of writes, in this order

0xff MSB }
0xee } 3 byte output
Expand All @@ -41,3 +43,5 @@ Thus, we actually get the following series of writes, in this order
0x96 LSB }


(5) For more info, read the source of pb_prog.c. It's quite simple.

0 comments on commit f6b9336

Please sign in to comment.