URL
https://opencores.org/ocsvn/scarts/scarts/trunk
Subversion Repositories scarts
[/] [scarts/] [trunk/] [toolchain/] [scarts-binutils/] [binutils-2.19.1/] [cgen/] [sim-test.scm] - Rev 6
Compare with Previous | Blame | View Log
; CPU description file generator for the simulator testsuite. ; Copyright (C) 2000, 2009 Red Hat, Inc. ; This file is part of CGEN. ; See file COPYING.CGEN for details. ; This is invoked to build allinsn.exp and a script to run to ; generate allinsn.s and allinsn.d. ; Specify which application. ; Called before/after the .cpu file has been read. ; Called after .cpu file has been read and global error checks are done. ; We use the `tmp' member to record the syntax split up into its components. ; Methods to compute test data. ; The result is a list of strings to be inserted in the assembler ; in the operand's position. ; FIXME: floating point support ; FIXME: Need to handle mach variants. "foodata""4""footext""-4""footext""4""foodata""-4"; This can't use method-make-forward! as we need to call op:type to ; resolve the hardware reference. ; Given an operand, return a set of N test data. ; e.g. For a keyword operand, return a random subset. ; For a number, return N numbers. ; Given the broken out assembler syntax string, return the list of operand ; objects. ; Given a list of operands for an instruction, return the test set ; (all possible combinations). ; N is the number of testcases for each operand. ; The result has N to-the-power (length OP-LIST) elements. ; FIXME: Make slicker later. ; Given an assembler expression and a set of operands build a testcase. ; SYNTAX-LIST is a list of syntax elements (characters) and <operand> objects. ; TEST-DATA is a list of strings, one element per operand. ; FIXME: wip "Building a testcase for: "" "", test data: "" ""\n";(display (list result sl td "\n")) "\t""\n"; Generate a set of testcases for INSN. ; FIXME: wip "Generating sim test set for "" ...\n""\t.global ""\n"":\n"; Generate the shell script that builds the .cgs files. ; .cgs are .s files except that there may be other .s files in the directory ; and we want the .exp driver script to easily find the files. ; ; Eventually it would be nice to generate as much of the testcase as possible. ; For now we just generate the template and leave the programmer to fill in ; the guts of the test (i.e. set up various registers, execute the insn to be ; tested, and then verify the results). ; Clearly some hand generated testcases will also be needed, but this ; provides a good start for each instruction. "Generating sim-build.sh ...\n""\ #/bin/sh # Generate test result data for "" simulator testing. # This script is machine generated. # It is intended to be run in the testsuite source directory. # # Syntax: /bin/sh sim-build.sh # Put results here, so we preserve the existing set for comparison. rm -rf tmpdir mkdir tmpdir cd tmpdir \n""cat <<EOF > "".cgs\n"; FIXME: Need to record assembler line comment char in .cpu. "# "" testcase for ""$"" -*- Asm -*-\n""# mach: ""all"",""\n\n""\t.include \"testutils.inc\"\n\n""\tstart\n\n""\n\tpass\n""EOF\n\n"; Generate the dejagnu allinsn.exp file that drives the tests. "Generating sim-allinsn.exp ...\n""\ # "" simulator testsuite. if [istarget ""*-*-*] { # load support procs (none yet) # load_lib cgen.exp # all machines set all_machs \""" ""\" # The .cgs suffix is for \"cgen .s\". foreach src [lsort [glob -nocomplain $srcdir/$subdir/*.cgs]] { # If we're only testing specific files and this isn't one of them, # skip it. if ![runtest_file_p $runtests $src] { continue } run_sim_test $src $all_machs } }\n"