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;
  • 相关阅读:
    IM客户端Socks 5代理协议应用
    招聘程序员的方法
    Power BI Embedded 与 Bot Framework 结合的AI报表系统
    Surface Dial 与 Windows Wheel UWP应用开发
    如何将 Microsoft Bot Framework 链接至微信公共号
    Mobilize.Net Silverlight bridge to Windows 10 UWP
    使用 Windows10 自定义交互消息通知
    如何使用新浪微博账户进行应用登录验证(基于Windows Azure Mobile Service 集成登录验证)
    NFC 与 Windows Phone 的那点事儿
    Windows Phone 支持中国移动官方支付
  • 原文地址:https://www.cnblogs.com/dpc525/p/8025301.html
Copyright © 2011-2022 走看看