Ignore:
Timestamp:
Sep 4, 2012, 6:47:24 PM (12 years ago)
Author:
alain
Message:

The vci_block_device_tsar_v4 component has been modified to support bursts
even when the memory buffer is not aligned on a cache line boundary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/vci_block_device_tsar_v4/caba/source/include/vci_block_device_tsar_v4.h

    r187 r260  
    3232// This component can perform data transfers between one single file belonging
    3333// to the host system and a buffer in the memory of the virtual prototype.
    34 // The file name is an argument of the constructor,
    35 // as well as the block size (bytes), and the burst size (bytes).
     34// The file name is an argument of the constructor.
    3635// This component has a DMA capability, and is both a target and an initiator.
     36// The block size (bytes), and the burst size (bytes) must be power of 2.
     37// The burst size is typically a cache line.
     38// If the memory buffer is not constrained to be aligned on a burst boundary.
    3739// Both read and write transfers are supported. An IRQ is optionally
    3840// asserted when the transfer is completed.
     
    9294
    9395    // Registers
    94     sc_signal<int>                              r_target_fsm;           // target fsm state register
    95     sc_signal<int>                              r_initiator_fsm;        // initiator fsm state register
    96     sc_signal<bool>                             r_irq_enable;           // default value is true
    97     sc_signal<uint32_t>                         r_nblocks;              // number of blocks to be transfered
    98     sc_signal<uint32_t>                         r_buf_address;          // memory buffer address
    99     sc_signal<uint32_t>                         r_lba;                  // first block index
    100     sc_signal<bool>                             r_read;                 // requested operation
    101     sc_signal<uint32_t>                         r_flit_count;           // flit counter (in a burst)
    102     sc_signal<uint32_t>                         r_burst_count;          // burst counter (in a block)
    103     sc_signal<uint32_t>                         r_block_count;          // block counter (in a transfer)
    104     sc_signal<uint32_t>                         r_latency_count;        // latency access (for each block)
    105     sc_signal<bool>                             r_go;                   // transmit command from T_FSM to M_FSM
     96    sc_signal<int>               r_target_fsm;           // target fsm state register
     97    sc_signal<int>               r_initiator_fsm;    // initiator fsm state register
     98    sc_signal<bool>              r_irq_enable;           // default value is true
     99    sc_signal<uint32_t>          r_nblocks;              // number of blocks in transfer
     100    sc_signal<uint32_t>          r_buf_address;          // memory buffer address
     101    sc_signal<uint32_t>          r_lba;                  // first block index
     102    sc_signal<bool>              r_read;                 // requested operation
     103    sc_signal<uint32_t>          r_index;                // flit index in local buffer
     104    sc_signal<uint32_t>          r_latency_count;    // latency counter
     105    sc_signal<uint32_t>          r_flit_count;           // flit counter (in a burst)
     106    sc_signal<uint32_t>          r_burst_count;          // burst counter (in a block)
     107    sc_signal<uint32_t>          r_block_count;          // block counter (in a transfer)
     108    sc_signal<uint32_t>          r_burst_offset;     // number of non aligned flits
     109    sc_signal<uint32_t>          r_burst_nflits;     // number of flits in a burst
     110    sc_signal<bool>              r_go;                   // command from T_FSM to M_FSM
     111
    106112    sc_signal<sc_dt::sc_uint<vci_param::S> >    r_srcid;                // save srcid
    107113    sc_signal<sc_dt::sc_uint<vci_param::T> >    r_trdid;                // save trdid
    108114    sc_signal<sc_dt::sc_uint<vci_param::P> >    r_pktid;                // save pktid
    109115
    110     uint32_t*                                   m_local_buffer;         // capacity is one block (block_size bytes)
     116    uint32_t*                    r_local_buffer;         // capacity is one block
    111117
    112118    // structural parameters
    113     soclib::common::Segment                     m_segment;              // segment associated to target
    114     uint32_t                                    m_srcid;                // initiator index
    115     int                                         m_fd;                   // File descriptor
    116     uint64_t                                    m_device_size;          // Total number of blocks
    117     const uint32_t                              m_flits_per_block;      // number of flits in a block
    118     const uint32_t                              m_flits_per_burst;      // number of flits in a burst
    119     const uint32_t                              m_bursts_per_block;     // number of bursts in a block
    120     const uint32_t                              m_latency;              // device latency
     119    soclib::common::Segment      m_segment;              // segment associated to target
     120    uint32_t                     m_srcid;                // initiator index
     121    int                          m_fd;                   // File descriptor
     122    uint64_t                     m_device_size;          // Total number of blocks
     123    const uint32_t               m_flits_per_block;      // number of flits in a block
     124    const uint32_t               m_flits_per_burst;      // number of flits in a burst
     125    const uint32_t               m_bursts_per_block; // number of bursts in a block
     126    const uint32_t               m_latency;              // device latency
    121127
    122128    // methods
     
    127133    enum {
    128134    M_IDLE              = 0,
     135
    129136    M_READ_BLOCK        = 1,
    130     M_READ_CMD          = 2,
    131     M_READ_RSP          = 3,
    132     M_READ_TEST         = 4,
     137    M_READ_BURST        = 2,
     138    M_READ_CMD          = 3,
     139    M_READ_RSP          = 4,
    133140    M_READ_SUCCESS      = 5,
    134141    M_READ_ERROR        = 6,
    135     M_WRITE_BLOCK       = 7,
     142
     143    M_WRITE_BURST       = 7,
    136144    M_WRITE_CMD         = 8,
    137145    M_WRITE_RSP         = 9,
    138     M_WRITE_TEST        = 10,
     146    M_WRITE_BLOCK       = 10,
    139147    M_WRITE_SUCCESS     = 11,
    140148    M_WRITE_ERROR       = 12,
     
    185193    // Constructor   
    186194    VciBlockDeviceTsarV4(
    187                 sc_module_name                          name,
     195                sc_module_name                      name,
    188196                const soclib::common::MappingTable      &mt,
    189197                const soclib::common::IntTab            &srcid,
    190198                const soclib::common::IntTab            &tgtid,
    191                 const std::string                       &filename,
    192                 const uint32_t                          block_size = 512,
    193                 const uint32_t                          burst_size = 64,
    194                 const uint32_t                          latency = 0);
     199        const std::string                   &filename,
     200        const uint32_t                      block_size = 512,
     201        const uint32_t                      burst_size = 64,
     202        const uint32_t                      latency = 0);
    195203};
    196204
Note: See TracChangeset for help on using the changeset viewer.