123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176 |
- /* Simulator model support for lm32bf.
- THIS FILE IS MACHINE GENERATED WITH CGEN.
- Copyright 1996-2015 Free Software Foundation, Inc.
- This file is part of the GNU simulators.
- This file is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3, or (at your option)
- any later version.
- It is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- License for more details.
- You should have received a copy of the GNU General Public License along
- with this program; if not, see <http://www.gnu.org/licenses/>.
- */
- #define WANT_CPU lm32bf
- #define WANT_CPU_LM32BF
- #include "sim-main.h"
- /* The profiling data is recorded here, but is accessed via the profiling
- mechanism. After all, this is information for profiling. */
- #if WITH_PROFILE_MODEL_P
- /* Model handlers for each insn. */
- static int
- model_lm32_add (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_addi (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_and (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_andi (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_andi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_andhii (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_andi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_b (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_be.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_bi (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_bi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_be (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_be.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_bg (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_be.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_bge (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_be.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_bgeu (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_be.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_bgu (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_be.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_bne (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_be.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_call (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_be.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_calli (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_bi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_cmpe (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_cmpei (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_cmpg (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_cmpgi (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_cmpge (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_cmpgei (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_cmpgeu (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_cmpgeui (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_andi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_cmpgu (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_cmpgui (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_andi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_cmpne (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_cmpnei (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_divu (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_lb (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_lbu (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_lh (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_lhu (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_lw (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_modu (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_mul (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_muli (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_nor (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_nori (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_andi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_or (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_ori (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_andi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_orhii (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_andi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_rcsr (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_rcsr.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_sb (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_sextb (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_sexth (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_sh (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_sl (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_sli (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_sr (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_sri (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_sru (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_srui (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_sub (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_sw (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_addi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_user (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_wcsr (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_wcsr.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_xor (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_xori (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_andi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_xnor (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_user.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_xnori (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_andi.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_break (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_empty.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- static int
- model_lm32_scall (SIM_CPU *current_cpu, void *sem_arg)
- {
- #define FLD(f) abuf->fields.sfmt_empty.f
- const ARGBUF * UNUSED abuf = SEM_ARGBUF ((SEM_ARG) sem_arg);
- const IDESC * UNUSED idesc = abuf->idesc;
- int cycles = 0;
- {
- int referenced = 0;
- int UNUSED insn_referenced = abuf->written;
- cycles += lm32bf_model_lm32_u_exec (current_cpu, idesc, 0, referenced);
- }
- return cycles;
- #undef FLD
- }
- /* We assume UNIT_NONE == 0 because the tables don't always terminate
- entries with it. */
- /* Model timing data for `lm32'. */
- static const INSN_TIMING lm32_timing[] = {
- { LM32BF_INSN_X_INVALID, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_X_AFTER, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_X_BEFORE, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_X_CTI_CHAIN, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_X_CHAIN, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_X_BEGIN, 0, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_ADD, model_lm32_add, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_ADDI, model_lm32_addi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_AND, model_lm32_and, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_ANDI, model_lm32_andi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_ANDHII, model_lm32_andhii, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_B, model_lm32_b, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_BI, model_lm32_bi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_BE, model_lm32_be, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_BG, model_lm32_bg, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_BGE, model_lm32_bge, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_BGEU, model_lm32_bgeu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_BGU, model_lm32_bgu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_BNE, model_lm32_bne, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CALL, model_lm32_call, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CALLI, model_lm32_calli, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CMPE, model_lm32_cmpe, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CMPEI, model_lm32_cmpei, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CMPG, model_lm32_cmpg, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CMPGI, model_lm32_cmpgi, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CMPGE, model_lm32_cmpge, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CMPGEI, model_lm32_cmpgei, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CMPGEU, model_lm32_cmpgeu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CMPGEUI, model_lm32_cmpgeui, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CMPGU, model_lm32_cmpgu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CMPGUI, model_lm32_cmpgui, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CMPNE, model_lm32_cmpne, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_CMPNEI, model_lm32_cmpnei, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_DIVU, model_lm32_divu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_LB, model_lm32_lb, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_LBU, model_lm32_lbu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_LH, model_lm32_lh, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_LHU, model_lm32_lhu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_LW, model_lm32_lw, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_MODU, model_lm32_modu, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_MUL, model_lm32_mul, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_MULI, model_lm32_muli, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_NOR, model_lm32_nor, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_NORI, model_lm32_nori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_OR, model_lm32_or, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_ORI, model_lm32_ori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_ORHII, model_lm32_orhii, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_RCSR, model_lm32_rcsr, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_SB, model_lm32_sb, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_SEXTB, model_lm32_sextb, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_SEXTH, model_lm32_sexth, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_SH, model_lm32_sh, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_SL, model_lm32_sl, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_SLI, model_lm32_sli, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_SR, model_lm32_sr, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_SRI, model_lm32_sri, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_SRU, model_lm32_sru, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_SRUI, model_lm32_srui, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_SUB, model_lm32_sub, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_SW, model_lm32_sw, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_USER, model_lm32_user, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_WCSR, model_lm32_wcsr, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_XOR, model_lm32_xor, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_XORI, model_lm32_xori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_XNOR, model_lm32_xnor, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_XNORI, model_lm32_xnori, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_BREAK, model_lm32_break, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- { LM32BF_INSN_SCALL, model_lm32_scall, { { (int) UNIT_LM32_U_EXEC, 1, 1 } } },
- };
- #endif /* WITH_PROFILE_MODEL_P */
- static void
- lm32_model_init (SIM_CPU *cpu)
- {
- CPU_MODEL_DATA (cpu) = (void *) zalloc (sizeof (MODEL_LM32_DATA));
- }
- #if WITH_PROFILE_MODEL_P
- #define TIMING_DATA(td) td
- #else
- #define TIMING_DATA(td) 0
- #endif
- static const MODEL lm32_models[] =
- {
- { "lm32", & lm32_mach, MODEL_LM32, TIMING_DATA (& lm32_timing[0]), lm32_model_init },
- { 0 }
- };
- /* The properties of this cpu's implementation. */
- static const MACH_IMP_PROPERTIES lm32bf_imp_properties =
- {
- sizeof (SIM_CPU),
- #if WITH_SCACHE
- sizeof (SCACHE)
- #else
- 0
- #endif
- };
- static void
- lm32bf_prepare_run (SIM_CPU *cpu)
- {
- if (CPU_IDESC (cpu) == NULL)
- lm32bf_init_idesc_table (cpu);
- }
- static const CGEN_INSN *
- lm32bf_get_idata (SIM_CPU *cpu, int inum)
- {
- return CPU_IDESC (cpu) [inum].idata;
- }
- static void
- lm32_init_cpu (SIM_CPU *cpu)
- {
- CPU_REG_FETCH (cpu) = lm32bf_fetch_register;
- CPU_REG_STORE (cpu) = lm32bf_store_register;
- CPU_PC_FETCH (cpu) = lm32bf_h_pc_get;
- CPU_PC_STORE (cpu) = lm32bf_h_pc_set;
- CPU_GET_IDATA (cpu) = lm32bf_get_idata;
- CPU_MAX_INSNS (cpu) = LM32BF_INSN__MAX;
- CPU_INSN_NAME (cpu) = cgen_insn_name;
- CPU_FULL_ENGINE_FN (cpu) = lm32bf_engine_run_full;
- #if WITH_FAST
- CPU_FAST_ENGINE_FN (cpu) = lm32bf_engine_run_fast;
- #else
- CPU_FAST_ENGINE_FN (cpu) = lm32bf_engine_run_full;
- #endif
- }
- const MACH lm32_mach =
- {
- "lm32", "lm32", MACH_LM32,
- 32, 32, & lm32_models[0], & lm32bf_imp_properties,
- lm32_init_cpu,
- lm32bf_prepare_run
- };
|