zoukankan      html  css  js  c++  java
  • uvm_mem_mam——寄存器模型(十三)

    有了存储器模型,再来看看存储器的管理

    //------------------------------------------------------------------------------
    //
    // Title: Memory Allocation Manager
    //
    // Manages the exclusive allocation of consecutive memory locations
    // called ~regions~.
    // The regions can subsequently be accessed like little memories of
    // their own, without knowing in which memory or offset they are
    // actually located.
    //
    // The memory allocation manager should be used by any
    // application-level process
    // that requires reserved space in the memory,
    // such as DMA buffers.
    //
    // A region will remain reserved until it is explicitly released. 
    //
    //------------------------------------------------------------------------------
    
    
    `ifndef UVM_MEM_MAM__SV
    `define UVM_MEM_MAM__SV
    
    
    typedef class uvm_mem_mam_cfg;
    typedef class uvm_mem_region;
    typedef class uvm_mem_mam_policy;
    
    typedef class uvm_mem;
    
    
    //------------------------------------------------------------------------------
    // CLASS: uvm_mem_mam
    //------------------------------------------------------------------------------
    // Memory allocation manager
    //
    // Memory allocation management utility class similar to C's malloc()
    // and free().
    // A single instance of this class is used to manage a single,
    // contiguous address space.
    //------------------------------------------------------------------------------
    
    class uvm_mem_mam;
    
       //----------------------
       // Group: Initialization
       //----------------------
    
       // Type: alloc_mode_e
       //
       // Memory allocation mode
       //
       // Specifies how to allocate a memory region
       //
       // GREEDY   - Consume new, previously unallocated memory
       // THRIFTY  - Reused previously released memory as much as possible (not yet implemented)
       //
       typedef enum {GREEDY, THRIFTY} alloc_mode_e;
    
    
       // Type: locality_e
       //
       // Location of memory regions
       //
       // Specifies where to locate new memory regions
       //
       // BROAD    - Locate new regions randomly throughout the address space
       // NEARBY   - Locate new regions adjacent to existing regions
       
       typedef enum {BROAD, NEARBY}   locality_e;
    
    
    
       // Variable: default_alloc
       //
       // Region allocation policy
       //
       // This object is repeatedly randomized when allocating new regions.
       uvm_mem_mam_policy default_alloc;
    
    
       local uvm_mem memory;
       local uvm_mem_mam_cfg cfg;
       local uvm_mem_region in_use[$];
       local int for_each_idx = -1;
       local string fname;
       local int lineno;
  • 相关阅读:
    总结6.6 PHP后台登录和文件上传
    【017期】JavaSE面试题(十七):JVM之内存模型
    【016期】JavaSE面试题(十六):反射
    【015期】JavaSE面试题(十五):网络IO流
    【014期】JavaSE面试题(十四):基本IO流
    【013期】JavaSE面试题(十三):多线程(3)
    【012期】JavaSE面试题(十二):多线程(2)
    【011期】JavaSE面试题(十一):多线程(1)
    【010期】JavaSE面试题(十):集合之Map
    【009期】JavaSE面试题(九):集合之Set
  • 原文地址:https://www.cnblogs.com/dpc525/p/8025301.html
Copyright © 2011-2022 走看看