bendime.exe

Quick links: usage summary, usage details, example

Name: bendime.exe

Location: ./noc/bendime (program) and ./noc/vidime (sources)

Syntax: bendime [-b bitfile] (-[w|r] <memtrans>)* [-v][-R][-t <sec>][-s]

Usage summary:

bendime.exe
does one or more of the following things:

  1. Configures the BenOne development board;
  2. Uploads the bitfile containing the mMIPS NOC implementation to the User FPGA;
  3. Performs one or more memory transfers ('r'ead or 'w'rite) to the mMIPS processors. Memory transfers <memtrans> are defined as <mem> <startaddr_mem> <size> <file> <startaddr_file> (see table 1).

    Table 1: Components of <memtrans> and their meanings.

    <memtrans> component Interpretation
    <mem> Value used for the memory select word (see table 2) to specify the memory to read from or write to.
    <startaddr_mem> Address of the first byte in the memory selected by <mem> where reading/writing should begin.
    <size> Number of words to read or write (a word is 4 bytes in the current implementation).
    <file> The input of output file, e.g. mips_rom.x0y0.bin.
    <startaddr_file> The address of the first byte in <file> where reading/writing should begin. A value of -1 means that the file should be emptied first if it exists.

    Table 2: Memory select word usage for a 2x2 network

    Bit (<mem> value) memory (without cache)memory (with cache)
    0 (1)instructions of dp_x0y0not used
    1 (2)data of dp_x0y0local instruction/data memory of dp_x0y0
    2 (4)instructions of dp_x1y0not used
    3 (8)data of dp_x1y0local instruction/data memory of dp_x1y0
    4 (16)instructions of dp_x0y1not used
    5 (32)data of dp_x0y1local instruction/data memory of dp_x0y1
    6 (64)instructions of dp_x1y1not used
    7 (128)data of dp_x1y1local instruction/data memory of dp_x1y1

    If -v is specified then each write transfer is verified with a read back transfer.

  4. Starts the processors;
  5. Runs for <sec> seconds if the -t option is given or until the user presses a key;
  6. Downloads the memories from the mMIPSes.

The option -R prevents an initial reset and clock setup and -s skips blocks of more than 4 zero-words when writing. See the NOC system architecture for more information about communication between the User FPGA and a PC. The remainder of this section gives the usage details of bendime.exe and an example.

Usage details:

bendime.exe is a compiled C program that uses the C API to communicate from a PC with the Nallatech FUSE software which comes with the development board. The User FPGA contains two modules, Comm.Core and BENIF_NET_WRAPPER, to support this interface. bendime.exe performs the following operations:

  1. Establish communication with BenOne board connected via USB.
  2. Set the clock #1 (CLKA) to run at 20MHz (used to clock the mMIPS).
  3. Set the clock #2 (CLKB/DSPCLK) to run at 40MHz (used to clock the communication interface).
  4. (if specified) Program the User FPGA (2V3000) with the specified bitfile.
  5. Perform all requested write memory transfers.
  6. Enable all processors in the network.
  7. Wait for the user to press a key. While waiting, the program counters of the processors in the network are read via BENIF_NET_WRAPPER and displayed.
  8. Disable all processors in the network.
  9. Perform all requested read memory transfers.
  10. Close communication channel with the board.

Note that all the write transfers are performed before the processors are enabled, and all the read transfers are performed after all processors are stopped.

Example:

The following call:

bendime.exe -b bennoc.bit -w 1 0 80 mem.x0y0.bin 0 -w 2 0 16 mem.x0y0.bin 4096 -w 4 0 80 mem.x1y0.bin 0 -w 8 0 16 mem.x1y0.bin 4096 -v -r 2 0 32 ram.x0y0.dump -1 -r 8 0 32 ram.x1y0.dump -1

will program the User FPGA with the bitfile bennoc.bit. Then it will transfer 80 words starting at position 0 in file mem.x0y0.bin to the address 0 of the memory selected by memory-select-word 1 (i.e. memory #0 - instruction memory of processor x0y0, see table 2). Then it will transfer 16 words starting at position 4096 in file mem.x0y0.bin to the address 0 of the data memory of processor x0y0 (memory #1, select-word binary b10 = 2); 80 words from position 0 of mem.x1y0.bin to instruction memory of processor x1y0; and finally 16 words from position 4096 of mem.x1y0.bin to the data memory of processor x1y0. All the write transfers will be verified by reading back the written data (-v switch).
After the transfers, the processors will run until the user presses any key. Then, the current contest of the data memories of processors x0y0 and x1y0 (memories 1 and 3, i.e. memory-select-words 2 and 8) will be stored in files ram.x0y0.dump and ram.x1y0.dump, respectively (in fact, the first 32 words of both memories will be read). The -1 used as offset parameter of the read transfer indicates that the target dump file, if it exists, should be truncated before the memory block is stored in it.

Other examples are in the batch files bennoc.bat and benapp.bat in ./noc/bendime.