OpenCores
URL https://opencores.org/ocsvn/ssbcc/ssbcc/trunk

Subversion Repositories ssbcc

[/] [ssbcc/] [trunk/] [README] - Diff between revs 2 and 3

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 2 Rev 3
Line 619... Line 619...
  timer         timing for polled loops or similar
  timer         timing for polled loops or similar
  trace         simulation diagnostic (see below)
  trace         simulation diagnostic (see below)
  UART          bidirectional UART
  UART          bidirectional UART
  UART_Rx       receive UART
  UART_Rx       receive UART
  UART_Tx       transmit UART
  UART_Tx       transmit UART
 
  wide_strobe   1 to 8 bit strobe generator
 
 
The following command illustrates how to display the help message for
The following command illustrates how to display the help message for
peripherals:
peripherals:
 
 
  echo "ARCHITECTURE core/9x8 Verilog" | ssbcc -P "big_inport help" - | less
  echo "ARCHITECTURE core/9x8 Verilog" | ssbcc -P "big_inport help" - | less
Line 999... Line 1000...
the width of the output signal is accessible using "${size['o_big']}".  You can
the width of the output signal is accessible using "${size['o_big']}".  You can
set the wide signal to all zeroes using:
set the wide signal to all zeroes using:
 
 
  ${(size['o_big']+7)/8-1} :loop 0 .outport(O_BIG) .jumpc(loop,1-) drop
  ${(size['o_big']+7)/8-1} :loop 0 .outport(O_BIG) .jumpc(loop,1-) drop
 
 
 
 
 
MACROS
 
================================================================================
 
There are 3 types of macros used by the assembler.
 
 
 
The first kind of macros are built in to the assembler and are required to
 
encode instructions that have embedded values or have mandatory subsequent
 
instructions.  These include function calls, jump instructions, function return,
 
and memory accesses as follows:
 
  .call(function,[op])
 
  .callc(function,[op])
 
  .fetch(ramName)
 
  .fetch+(ramName)
 
  .fetch-(ramName)
 
  .jump(label,[op])
 
  .jumpc(label,[op])
 
  .return([op])
 
  .store(ramName)
 
  .store+(ramName)
 
  .store-(ramName)
 
 
 
The second kind of macros are designed to ease access to input and output
 
operations and for memory accesses and to help ensure these operations are
 
correctly constructed.  These are defined as python scripts in the
 
core/9x8/macros directory and are automatically loaded into the assembler.
 
These macros are:
 
  .fetchindexed(variable)
 
  .fetchoffset(variable,ix)
 
  .fetchvalue(variableName)
 
  .fetchvector(variableName,N)
 
  .inport(I_name)
 
  .outport(O_name[,op])
 
  .outstrobe(O_name)
 
  .storeindexed(variableName[,op])
 
  .storeoffset(variableName,ix[,op])
 
  .storevalue(variableName[,op])
 
  .storevector(variableName,N)
 
 
 
The third kind of macro is user-defined macros.  These macros must be registered
 
with the assembler using the ".macro" directive.
 
 
 
For example, the ".push32" macro is defined by macros/9x8/push32.py and can be
 
used to push 32-bit (4-byte) values onto the data stack as follows:
 
 
 
  .macro push32
 
  .constant C_X 0x87654321
 
  .main
 
    ...
 
    .push32(0x12345678)
 
    .push32(C_X)
 
    .push32(${0x12345678^C_X})
 
    ...
 
 
 
The following macros are provided in macros/9x8:
 
  .push16(v)    push the 16-bit (2-byte) value "v" onto the data stack with the
 
                MSB at the top of the data stack
 
  .push32(v)    push the 32-bit (4-byte) value "v" onto the data stack with the
 
                MSB at the top of the data stack
 
 
 
Directories are searched in the following order for macros:
 
  .
 
  ./macros
 
  include paths specified by the '-M' command line option.
 
  macros/9x8
 
 
 
The python scripts in core/9x8/macros and macros/9x8 can be used as design
 
examples for user-defined macros.  The assembler does some type checking based
 
on the list provided when the macro is registered by the "AddMacro" method, but
 
additional type checking is often warranted by the macro "emitFunction" which
 
emits the actual assembly code.  The ".fetchvector" and ".storevector" macros
 
demonstrates how to design variable-length macros.
 
 
 
It is not an error to repeat the ".macro MACRO_NAME" directive for user-defined
 
macros.  The assembler will issue a fatal error if a user-defined macro
 
conflicts with a built-in macro.
 
 
 
 
CONDITIONAL COMPILATION
CONDITIONAL COMPILATION
================================================================================
================================================================================
The computer compiler and assembler recognize conditional compilation as
The computer compiler and assembler recognize conditional compilation as
follows:  .IFDEF, .IFNDEF, .ELSE, and .ENDIF can be used in the architecture
follows:  .IFDEF, .IFNDEF, .ELSE, and .ENDIF can be used in the architecture
file and they can be used to conditionally include functions, files, etc within
file and they can be used to conditionally include functions, files, etc within

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.