亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? flatmem.c

?? realview22.rar
?? C
?? 第 1 頁 / 共 4 頁
字號:
/* flatmem.c - Fast ARMulator memory interface.
 * (formerly known as armflat.c.)
 * Copyright (C) Advanced RISC Machines Limited, 1995-1998. 
 * Copyright (C) 1998-2001  ARM Limited.
 * All rights reserved.
 *
 * RCS $Revision: 1.1.2.31.2.3 $
 * Checkin $Date: 2003/09/24 16:40:02 $
 * Revising $Author: dsinclai $
 */

#include <string.h>             /* for memset */
#include <ctype.h>              /* for toupper */
#include "rdi.h"
#include "rdi_priv.h"
#include "rdi_prop.h"

#include "simplelinks.h"
#include "armul_callbackid.h"
#include "perip2rdi.h"         /* Perip2Memret */
#include "minperip.h"
#include "addcounter.h"
#include "armul_lib.h"         /* for ARMul_SIRange() */
#include "armul_agent.h"       /* for ARMulAgent_* */
#define ACDTEST(FUNC,RET) if (FUNC == RDIError_BufferFull) \
                               RET = RDIError_BufferFull

#include "armul_mem.h" /* for ARMul_Cycles ... */
#include "rdi_conf.h"
#include "armul_cnf.h"
#include "clxlist.h"
#include "armul_cyc.h"
#define NO_BYTELANES

/* NUL_BIU owns ABus now. */
/* #define FLAT_OWNS_ABUS */

/* debug options */
#ifndef NDEBUG
# if 1
#  define VERBOSE_NewLeafPageAllocated
# else
#  define VERBOSE_BUS
#  define VERBOSE_PERIPHERAL_ICYCLES
#  define VERBOSE_MEM_TYPE
#  define VERBOSE_CYCLE_DESC
# endif
#endif

#ifdef VERBOSE_DABORT
# define return_PERIP_DABORT \
    printf("\n*** Flatmem returns PERIP_DABORT ***\n"); \
    return_PERIP_DABORT
#else
# define return_PERIP_DABORT return PERIP_DABORT
#endif

#ifdef HOST_ENDIAN_BIG
# define HostEndian 1
#elif defined(HOST_ENDIAN_LITTLE)
# define HostEndian 0
#else
# error "HOST_ENDIAN_UNKNOWN"
#endif


#define NUMPAGES 64 * 1024
#define ARMFLAT_PAGESIZE 64 * 1024
#define PAGEBITS 16
#define OFFSETBITS_WORD 0xfffc

typedef struct {
  ARMword memory[ARMFLAT_PAGESIZE/4];
} mempage;

typedef struct {
  mempage *page[NUMPAGES];
} memory;

BEGIN_STATE_DECL(Flatmem)
  /* things that need to be accessed quickly at the start */
  unsigned read_bigend, write_bigend;
  unsigned int sa_memacc_flag;
  ARMul_Cycles cycles;
  ARMul_Cycles saved_cycles;
  ARMTime saved_bus_BusyUntil;
  ARMword LowestPeripheralAddress, HighestPeripheralAddress;


  ARMword byteAddrXor,hwordAddrXor; /* for reads */

#ifdef FLAT_OWNS_ABUS /*F*/
 /* Was ARMul_State->as_ABus */
  ARMul_Bus fm_ABus;
#endif
  ARMul_Bus *p_ABus;
  ARMul_MemInterface bus_mem;
  ARMul_MemInterfaceRef mem_ref;


  memory mem;                 /* big data structure in the middle */
                              /* things that are rarely accessed at the end */
  ARMul_MemType memtype;
  bool memory_byte_sex;         /* memory bytesex is fixed */
    bool BaseMemoryEnabled;
double clk;

    ARMTime clk_speed;

    struct GenericAccessCallback *NewPageAllocated;

    RDI_AgentHandle agent;
    bool bI_Cycles;
  char *mf_CycleNames[16];
END_STATE_DECL(Flatmem) /*  toplevel; */

#define toplevel FlatmemState

/*
 * ARMulator callbacks
 */
static unsigned ARMFlat_DebugEvents(void *handle, void *data)
{
  toplevel *top=(toplevel *)handle;  
  ARMul_Event *evt = (ARMul_Event *)data;
  if(evt->event == DebugEvent_RunCodeSequence)
  {
      /* save cycle counts */
      top->saved_bus_BusyUntil = top->p_ABus->bus_BusyUntil;
      top->saved_cycles = top->cycles;
  }
  if(evt->event == DebugEvent_EndCodeSequence)
  {
      /* restore cycle counts */
      top->p_ABus->bus_BusyUntil = top->saved_bus_BusyUntil;
      top->cycles = top->saved_cycles;
  }
    
  return FALSE;
}

static void ConfigChange(void *handle, unsigned bNewBigend)
{
  toplevel *top=(toplevel *)handle;
  /* bigendian swapping for reads is ALWAYS done by the memory model */
  top->read_bigend = bNewBigend; /* ((newValue & ARM_MMU_B) != 0); */

  top->byteAddrXor = ( top->read_bigend != HostEndian ) ? 3 : 0;
  top->hwordAddrXor = ( top->read_bigend != HostEndian ) ? 2 : 0;

#ifdef VERBOSE_CONFIGCHANGE
  printf("Flatmem:ConfigChange bNewBigend:%u\n",(unsigned)bNewBigend);
#endif


  /* If we have "fixed" bigend for the memory, then swapping for writes is
   * fixed, otherwise it is the same as for reads
   */
  if (top->memory_byte_sex == FALSE)
    top->write_bigend = top->read_bigend;
}

/* static void Interrupt(void *handle,unsigned int which) */
static unsigned Flatmem_ConfigEvents(void *handle, void *data)
{
  toplevel *top=(toplevel *)handle;
  ARMul_Event *evt = (ARMul_Event *)data;

  switch (evt->event)
  {
  case ConfigEvent_Reset:
    memset(&top->cycles,0,sizeof(top->cycles));
    top->p_ABus->bus_BusyUntil = 0;
    ARMul_BusLimits(top->p_ABus, &top->LowestPeripheralAddress,
                    &top->HighestPeripheralAddress, 1);

        break;
  case ConfigEvent_EndiannessChanged:
          ConfigChange(handle, evt->data1);
          break;
  default:
          return ARMFlat_DebugEvents(handle, data);
  }
  return FALSE;
}


static void ARMFlat_SetBaseMemoryEnable(toplevel *top, uint32 value)
{
    top->BaseMemoryEnabled = BOOLIFY(value);
}

#define GET_PRIMARY_ID(argx) (*(unsigned *)argx) 
#define GET_INDEXED_ID(argx,ndex) (((unsigned *)argx)[ndex])


static int UnkRDIInfo(void *handle, unsigned type, ARMword *arg1,ARMword *arg2)
{
  toplevel *top = (toplevel *)handle;
  int  retVal = RDIError_UnimplementedMessage;

  if (!top->BaseMemoryEnabled)
      return retVal;

  switch(type) {
  case RDICycles: 
  {
        void *state = NULL; /* ARMul_State, top->state; */
    ARMTime total;
    ARMul_AddCounterValue64(state, arg1, arg2, top->cycles.NumScycles);
    ARMul_AddCounterValue64(state, arg1, arg2, top->cycles.NumNcycles);
    ARMul_AddCounterValue64(state, arg1, arg2, top->cycles.NumIcycles);
    ARMul_AddCounterValue64(state, arg1, arg2, top->cycles.NumCcycles);
    total = (top->cycles.NumScycles + top->cycles.NumNcycles +
             top->cycles.NumIcycles + top->cycles.NumCcycles);
    ARMul_AddCounterValue64(state, arg1, arg2, total);
    break; /* Allow more */
  }
  case RDIRequestCyclesDesc:
  {
          void *state = NULL;

          if (top->memtype == ARMul_MemType_PipelinedARM9 ||
              top->memtype == ARMul_MemType_StrongARM ||
              top->memtype == ARMul_MemType_ARM9)
          {
              if( top->memtype == ARMul_MemType_StrongARM) {
                  top->mf_CycleNames[1]="Core_ID";
                  top->mf_CycleNames[0]="Core_IOnly";
                  top->mf_CycleNames[2]="Core_Idles";
                  top->mf_CycleNames[3]="Core_DOnly";
              } else {
                  top->mf_CycleNames[1]="ID_Cycles";
                  top->mf_CycleNames[0]="IBus_Cycles";
                  top->mf_CycleNames[2]="Idle_Cycles";
                  top->mf_CycleNames[3]="DBus_Cycles";
              }
              ACDTEST(ARMul_AddCounterDesc(
                  NULL, arg1, arg2, 
                  top->mf_CycleNames[1] /*"ID_Cycles"*/), retVal);
              ACDTEST(ARMul_AddCounterDesc(
                  NULL, arg1, arg2, 
                  top->mf_CycleNames[0]/*"IBus_Cycles"*/), retVal);
              ACDTEST(ARMul_AddCounterDesc(
                  NULL, arg1, arg2,
                  top->mf_CycleNames[2]/*"Idle_Cycles"*/), retVal);
              ACDTEST(ARMul_AddCounterDesc(
                  NULL, arg1, arg2,
                  top->mf_CycleNames[3]/*"DBus_Cycles"*/), retVal);
#ifdef VERBOSE_CYCLE_DESC
              printf("ARMflat RDIRequestCyclesDesc Harvard.\n");
#endif
          } else {
              top->mf_CycleNames[1]="S_Cycles";
              top->mf_CycleNames[0]="N_Cycles";
              top->mf_CycleNames[2]="I_Cycles";
              top->mf_CycleNames[3]="C_Cycles";
              if(!top->bI_Cycles)
                  ARMulif_ReadCycleNames(&top->mf_CycleNames[0],16,
                                         top->memtype,top->config);
              ACDTEST(ARMul_AddCounterDesc(
                  NULL, arg1, arg2,
                  top->mf_CycleNames[1]/*"S_Cycles"*/), retVal);
              ACDTEST(ARMul_AddCounterDesc(
                  NULL, arg1, arg2,
                  top->mf_CycleNames[0]/*"N_Cycles"*/), retVal);
              ACDTEST(ARMul_AddCounterDesc(
                  NULL, arg1, arg2,
                  top->mf_CycleNames[2]/*"I_Cycles"*/), retVal);
              ACDTEST(ARMul_AddCounterDesc(
                  NULL, arg1, arg2,
                  top->mf_CycleNames[3]/*"C_Cycles"*/), retVal);
          }  
          ACDTEST(ARMul_AddCounterDesc(state, arg1, arg2, "Total"), retVal);
          break; /* Allow more */
  }

  case RDIProperty_SetAsNumeric:
  { /* Currently, only signals. */
      unsigned ID = (unsigned)arg1;
      switch (ID)
      {
      case RDIPropID_ARMSignal_BaseMemoryEnable:
          ARMFlat_SetBaseMemoryEnable(top,*arg2);
          ARMul_BusLimits(top->p_ABus, &top->LowestPeripheralAddress,
                          &top->HighestPeripheralAddress, 1);

          return RDIError_NoError;

      default: break;
      }
      break;
  }
  case RDIInfo_RegisterCallback:
  {
      unsigned ID = GET_PRIMARY_ID(arg1);
      switch(ID)
      {
      case ARMulCallbackID_NewLeafPageAllocated:
#ifdef VERBOSE_NewLeafPageAllocated
          printf("\nflatmem.c:RDIInfo_RegisterCallback:ARMulCallbackID_NewLeafPageAllocated\n");
#endif
          return ARMulif_InstallGenericAccessCallback(&top->NewPageAllocated,
                                              (GenericAccessCallback*)arg2);
      default: break;
      }
      break;

  }
  case RDIInfo_DeregisterCallback:
  {
      unsigned ID = GET_PRIMARY_ID(arg1);
      switch(ID)
      {
      case ARMulCallbackID_NewLeafPageAllocated:
          return ARMulif_RemoveGenericAccessCallback(&top->NewPageAllocated,
                                                     (void*)arg2);
      default: break;
      }
      break;
  }

  case RDIInfo_QueryMemInterface:
  {
      unsigned ID = GET_PRIMARY_ID(arg1);
      switch (ID) {
      case ARMulBusID_Memory: /* Leaf memory, usually flat */
          *(ARMul_MemInterface**)arg2 = top->mem_ref.mif;
          return RDIError_NoError;
      default:break;
      }
      break;
  }

#ifdef FLAT_OWNS_ABUS
  case RDIInfo_QueryBus:
  {
      void **pBus = (void**)arg2;
      char const *name = (char const *)arg1;
      if (name[0]==(char)0 || name[1]==(char)0) {
          /* Flatmem only uses single-char names only so far. */
          switch(*name) {
          case '\0':
          case 'A':
              *pBus = top->p_ABus;
              return RDIError_NoError;
          default:
              break;
          }
      }
  }
#endif

  default: break;
  }
  return retVal;
}


/*
 * Predeclare the memory access functions so that the initialisation function
 * can fill them in
 */
#ifdef PIPELINED
static void NextCycle(void *,ARMword,ARMul_acc);
static void NextDCycle(void *,ARMword,ARMul_acc);
static void NextICycle(void *,ARMword,ARMul_acc);
#endif

#ifdef OldCode
static armul_MemAccAsync MemAccessAsync;
#endif
static void MemAccessHarvard(void *,ARMword,ARMword *,ARMul_acc, int *,
                                    ARMword,ARMword *,ARMul_acc, int *);
static int MemAccess(void *,ARMword,ARMword *,ARMul_acc);
static int MemAccessCached(void *,ARMword,ARMword *,ARMul_acc);
static int MemAccessThumb(void *,ARMword,ARMword *,ARMul_acc);
/* This expects D,I call-pairs, and accounts like Harvard. */
static int MemAccessSA(void *,ARMword,ARMword *,ARMul_acc);
#ifndef NO_BYTELANES
static int MemAccessBL(void *,ARMword,ARMword *,ARMul_acc);
#endif
#ifdef MEM_ACCESS2_DISTINCT
static int MemAccess2(void *,ARMword,ARMword *,ARMword *,ARMul_acc);
#endif
static unsigned int DataCacheBusy(void *);

static const ARMul_Cycles *Flat_ReadCycles(void *handle);
static unsigned long Flat_GetCycleLength(void *handle);
static unsigned Flat_MemInfo(void *handle, unsigned type, ARMword *pID,
                        uint64 *data);
static GenericAccessFunc flat_newPage;


/* Needed for VC++6 */
static double u64_to_dbl(uint64 v)
{
    int64 v2 = (int64)v;
    return (double)v2;
}



static ARMTime Flat_ReadClock(void *handle)
{
  /* returns a us count */
  toplevel *top=(toplevel *)handle;
  double t=(u64_to_dbl(top->cycles.NumNcycles) +
            u64_to_dbl(top->cycles.NumScycles) +
            u64_to_dbl(top->cycles.NumIcycles) +
            u64_to_dbl(top->cycles.NumCcycles))*top->clk;
#if 0
  printf("Flat_ReadClock->%f (clk=%f)\n",t,top->clk);
#endif
  return (ARMTime)(int64)t;
}

/* armmmu requires log2(0) == 0 */
static int flatmem_log2(unsigned int value)
{
    unsigned short n = 0;
    while( (value >>= 1) != 0 )
    {
        n++;
    }
    return n;
}


static int flatmem_masterInfo(toplevel *top, unsigned type,
                              ARMword *address, uint64 *data)
{
    return top->mem_ref.master_info ?
        top->mem_ref.master_info(top->mem_ref.handle,
                                    type,address,data) :
        RDIError_UnimplementedMessage;
}


BEGIN_INIT(Flatmem)
{
    /* Leaf memory, usually flatmem  */
    static uint32 ID_Mem[2] = {ARMulBusID_Memory,0};

    ARMul_MemInterface *interf = 
        ARMulif_QueryMemInterface(&state->coredesc, &ID_Mem[0]); /* "mif" */
    ARMul_MemType memtype;
    bool_int verbose = ToolConf_DLookupBool(config,(tag_t)"VERBOSE",FALSE);
  memory *mem;
  unsigned page;
  ARMword clk_speed = 0;
  const char *option;
  toplevel *top=(toplevel *)state;
  if (top == NULL) 
          return RDIError_OutOfStore;

  /* If we didn't get the connection we wanted, to replace the
   * built-in armflat, then ask for the output of the bus-interface. */
  if (interf == NULL)
  {
    /* Output of NUL_BIU (from cache or uncached core) */
    static uint32 ID_Bus[2] = {ARMulBusID_Bus,0};
    interf = ARMulif_QueryMemInterface(&state->coredesc, &ID_Bus[0]);
  }


  top->bI_Cycles =  ToolConf_DLookupBool(config,(tag_t)"ICycles",FALSE);
#ifdef FLAT_OWNS_ABUS /*F*/
  top->p_ABus = &top->fm_ABus;
#endif


  if (!interf)
  {
      static uint32 ID_CORE[2] = {ARMulBusID_Core,0};
      interf = 
          ARMulif_QueryMemInterface(&state->coredesc, &ID_CORE[0]);
#ifdef VERBOSE /* Not really a failure - we expect this for uncached cores. */
      Hostif_PrettyPrint(hostif,config,

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜桃久久av一区| 午夜精品久久一牛影视| 床上的激情91.| 久久精品视频免费| av在线不卡免费看| 夜夜精品视频一区二区| 欧美一卡在线观看| 国产做a爰片久久毛片| 国产肉丝袜一区二区| 99re66热这里只有精品3直播| √…a在线天堂一区| 欧美日韩在线播放一区| 美女高潮久久久| 国产日韩欧美高清| 在线观看日韩电影| 老汉av免费一区二区三区| 国产人妖乱国产精品人妖| jizzjizzjizz欧美| 午夜私人影院久久久久| 精品精品欲导航| 99久久99久久久精品齐齐| 日韩高清不卡在线| 国产精品毛片大码女人| 欧美日韩中文字幕一区| 国产在线视频一区二区| 亚洲欧美韩国综合色| 一区二区三区视频在线看| 日韩一区二区视频| 99久久精品免费精品国产| 青青草成人在线观看| 亚洲国产成人午夜在线一区| 欧美午夜在线一二页| 国产精品综合在线视频| 怡红院av一区二区三区| 久久精子c满五个校花| 欧洲一区二区三区在线| 国产丶欧美丶日本不卡视频| 亚洲成人免费电影| 国产精品久久久久久久浪潮网站| 欧美精品第1页| 不卡的av在线| 极品少妇一区二区三区精品视频| 一区二区三区中文在线观看| 精品国产一区二区三区久久久蜜月| 99久久久久久| 国产在线看一区| 亚洲图片欧美一区| 国产精品久久久爽爽爽麻豆色哟哟| 欧美大胆一级视频| 制服丝袜中文字幕一区| 91官网在线免费观看| 99久久精品国产精品久久| 国产综合一区二区| 日本在线观看不卡视频| 亚洲午夜精品17c| 日韩理论电影院| 2022国产精品视频| 欧美日韩精品一区视频| 欧洲国内综合视频| caoporm超碰国产精品| 岛国一区二区三区| 国产一区二区0| 九九视频精品免费| 久久精品国产成人一区二区三区 | 91一区二区在线| 大胆亚洲人体视频| 国产乱色国产精品免费视频| 久久精品国产一区二区三| 午夜精品爽啪视频| 图片区小说区国产精品视频| 亚洲午夜私人影院| 午夜精品视频一区| 天天av天天翘天天综合网色鬼国产 | 国产一区二区h| 国产精品影视在线观看| 国产成人一区二区精品非洲| 国产成人综合自拍| 成人h精品动漫一区二区三区| 成人午夜免费电影| 97精品电影院| 欧美日韩在线播放三区四区| 欧美年轻男男videosbes| 欧美一级艳片视频免费观看| 日韩三级伦理片妻子的秘密按摩| 日韩视频在线你懂得| 精品久久人人做人人爰| 精品久久人人做人人爽| 日本一区二区三区国色天香 | 美女视频网站久久| 精品一区二区三区日韩| 国产中文字幕一区| 成人app网站| 色综合视频在线观看| 欧美唯美清纯偷拍| 精品日本一线二线三线不卡| 亚洲国产成人私人影院tom| 国产精品天美传媒| 亚洲成人自拍偷拍| 狠狠v欧美v日韩v亚洲ⅴ| 成人禁用看黄a在线| 欧美日韩一区二区在线视频| 69久久夜色精品国产69蝌蚪网| 欧美不卡一区二区| 亚洲欧洲日产国码二区| 日本vs亚洲vs韩国一区三区二区| 国产一区二区三区免费播放| 色综合天天综合在线视频| 69久久99精品久久久久婷婷 | 国产精品456露脸| 91国内精品野花午夜精品 | 国产喷白浆一区二区三区| 亚洲免费成人av| 狠狠色丁香久久婷婷综| 日本乱码高清不卡字幕| 精品国产成人系列| 亚洲亚洲人成综合网络| 国产精品一区在线| 欧美日韩在线观看一区二区| 国产视频一区在线观看| 午夜成人免费电影| 成人黄色软件下载| 日韩视频国产视频| 1024亚洲合集| 国产精品一区二区你懂的| 欧美性猛片xxxx免费看久爱| 精品国产免费人成电影在线观看四季| 日韩一区在线免费观看| 国产在线看一区| 欧美二区三区91| 亚洲日本青草视频在线怡红院| 久草在线在线精品观看| 欧美三级乱人伦电影| 国产精品天美传媒沈樵| 久久av资源网| 欧美日韩一二区| 国产精品第13页| 成人一区二区在线观看| 日韩欧美久久一区| 天天亚洲美女在线视频| 一本一本久久a久久精品综合麻豆| 精品国产精品网麻豆系列| 亚洲大型综合色站| 91九色02白丝porn| 亚洲色图在线视频| 不卡一区二区中文字幕| 国产视频视频一区| 国产一区亚洲一区| 2023国产精品| 国产一区二区三区国产| 欧美xxxxx牲另类人与| 免费观看成人av| 91精品国产综合久久久久| 亚洲一区二区三区免费视频| 91蜜桃免费观看视频| 亚洲欧洲精品一区二区三区 | 久久精品视频在线看| 国产乱对白刺激视频不卡| 精品久久久久久久久久久久久久久久久| 日日夜夜免费精品视频| 欧美精品精品一区| 三级一区在线视频先锋 | 亚洲黄色免费网站| 91原创在线视频| 一区二区三区在线看| 欧美中文一区二区三区| 亚洲国产一区二区视频| 欧美日韩aaa| 蜜臀av性久久久久av蜜臀妖精| 日韩视频免费观看高清在线视频| 视频一区中文字幕| 亚洲成a人片综合在线| 欧美日韩中文国产| 免费看日韩精品| 久久久精品天堂| av中文字幕在线不卡| 国产精品二三区| 日本道在线观看一区二区| 亚洲gay无套男同| 日韩女同互慰一区二区| 国产精品正在播放| 国产精品久久三区| 欧美三级中文字幕| 蜜乳av一区二区| 久久综合资源网| 99国产麻豆精品| 五月婷婷久久综合| 欧美大片在线观看| 国产不卡在线播放| 亚洲一区二区视频在线观看| 7777精品久久久大香线蕉| 国产一区二区三区综合| 中文字幕在线不卡一区二区三区| 色婷婷综合久久久久中文一区二区| 天天亚洲美女在线视频| 欧美精品一区二区三区蜜桃视频| 成人精品免费网站| 午夜视频一区二区三区| 国产三级欧美三级日产三级99 | 成人免费视频国产在线观看| 亚洲精品免费在线播放|