at.dms.kjc.common
Class RawSimulatorPrint
java.lang.Object
at.dms.kjc.common.RawSimulatorPrint
public class RawSimulatorPrint
- extends Object
This class gathers common code for printing on the raw simulator,
including C code defines and SIRPrintStatement code generation.
It is used by the old RawBackend, SpaceDynamic, and SpaceTime.
- Author:
- mgordon
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
STREAMIT_PRINT_INT
public static String STREAMIT_PRINT_INT
STREAMIT_PRINT_FLOAT
public static String STREAMIT_PRINT_FLOAT
RawSimulatorPrint
public RawSimulatorPrint()
getHeader
public static String getHeader()
- Return the header (c #define statements) that defines the print
macros for integers and floats.
- Returns:
- the header that defines the print macros for integers and floats.
bCMagicHandler
public static String bCMagicHandler()
- Return the bC code that will define the magic print handler and
register the handler.
- Returns:
- the bC code that will define the magic print handler and
register the handler.
visitPrintStatement
public static void visitPrintStatement(SIRPrintStatement self,
JExpression exp,
CodegenPrintWriter p,
ToC toC)
- Generate code for an SIRPrintstatement when we are targeting the
raw simulator. We use two magic instructions, one to print int types and
one to print floats, to pass the value we would like to print to the
simulator runtime so it can display it. We convert each print
statement into a call of a macro defined to call the appropriate
magic instruction.
- Parameters:
self
- The print statementexp
- The expression to printp
- The CodeGenPrinter to append the code to.toC
- The parent visiter used to visit the exp.