gen-semantics.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /* This file is part of the program psim.
  2. Copyright (C) 1994-1995, Andrew Cagney <cagney@highland.com.au>
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, see <http://www.gnu.org/licenses/>.
  13. */
  14. /* Creates the files semantics.[hc].
  15. The generated file semantics contains functions that implement the
  16. operations required to model a single target processor instruction.
  17. Several different variations on the semantics file can be created:
  18. o uncached
  19. No instruction cache exists. The semantic function
  20. needs to generate any required values locally.
  21. o cached - separate cracker and semantic
  22. Two independant functions are created. Firstly the
  23. function that cracks an instruction entering it into a
  24. cache and secondly the semantic function propper that
  25. uses the cache.
  26. o cached - semantic + cracking semantic
  27. The function that cracks the instruction and enters
  28. all values into the cache also contains a copy of the
  29. semantic code (avoiding the need to call both the
  30. cracker and the semantic function when there is a
  31. cache miss).
  32. For each of these general forms, several refinements can occure:
  33. o do/don't duplicate/expand semantic functions
  34. As a consequence of decoding an instruction, the
  35. decoder, as part of its table may have effectivly made
  36. certain of the variable fields in an instruction
  37. constant. Separate functions for each of the
  38. alternative values for what would have been treated as
  39. a variable part can be created.
  40. o use cache struct directly.
  41. When a cracking cache is present, the semantic
  42. functions can be generated to either hold intermediate
  43. cache values in local variables or always refer to the
  44. contents of the cache directly. */
  45. extern insn_handler print_semantic_declaration;
  46. extern insn_handler print_semantic_definition;
  47. extern void print_idecode_illegal
  48. (lf *file,
  49. const char *result);
  50. extern void print_semantic_body
  51. (lf *file,
  52. insn *instruction,
  53. insn_bits *expanded_bits,
  54. opcode_field *opcodes);