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;
  • 相关阅读:
    linux(centos)搭建SVN服务器
    应该具备的能力
    Oracle trunc()函数的用法
    Realistic View for Autodesk Revit 2021
    Snowman
    A Material-Texture Painting Tool
    A Color Picker based on manifold learning
    CPU Path Tracing Renderer
    Rig Space FEM Simulation
    MPM Snow Simulation
  • 原文地址:https://www.cnblogs.com/dpc525/p/8025301.html
Copyright © 2011-2022 走看看