| 1 | [wiki:Component SocLib Components General Index] |
| 2 | |
| 3 | = !VciMwmrController Functional Description = |
| 4 | |
| 5 | This VCI component is both a target and an initiator. |
| 6 | * Addressing as a target allows to configure it for a transfer. |
| 7 | * Initiator will do the transfer |
| 8 | |
| 9 | This component may handle interfaces to a Fifo-accessed coprocessor. There |
| 10 | may be any number of fifos from/to the coprocessor. |
| 11 | |
| 12 | In conjunction with the fifos, there are multiple unidirectionnal 32-bits signals |
| 13 | going from/to the coprocessor. |
| 14 | * from the coprocessor, they are ''status'' registers |
| 15 | * to the coprocessor, they are ''config'' registers |
| 16 | |
| 17 | This hardware component cheks for segmentation violation, and can be used |
| 18 | as a default target. |
| 19 | |
| 20 | = Memory region layout = |
| 21 | |
| 22 | * Registers 0 to `MWMR_IOREG_MAX` |
| 23 | When read from, they reflects status registers, when written to, they reflects the control registers. |
| 24 | |
| 25 | * `MWMR_RESET` |
| 26 | When written to, this register resets the current state of the controller, flushing all fifos and configuration. |
| 27 | |
| 28 | * `MWMR_CONFIG_FIFO_WAY` and `MWMR_CONFIG_FIFO_NO` |
| 29 | Used to designate the currently configured fifo. WAY may be `MWMR_TO_COPROC` or `MWMR_FROM_COPROC`, NO may be any of available fifos in the selected way. |
| 30 | |
| 31 | * `MWMR_CONFIG_STATE_ADDR` |
| 32 | Sets the address of state field for the selected fifo's state block. |
| 33 | |
| 34 | * `MWMR_CONFIG_OFFSET_ADDR` |
| 35 | Sets the address of read/write pointer field for the selected fifo's state block. |
| 36 | |
| 37 | * `MWMR_CONFIG_LOCK_ADDR` |
| 38 | Sets the address of lock for the selected fifo's state block. |
| 39 | |
| 40 | * `MWMR_CONFIG_DEPTH` |
| 41 | Sets the depth of the selected fifo. |
| 42 | |
| 43 | * `MWMR_CONFIG_WIDTH` |
| 44 | Sets the width of the selected fifo. This will determine the atomic transfer block size. This must be multiple of 4. |
| 45 | |
| 46 | * `MWMR_CONFIG_BASE_ADDR` |
| 47 | Sets the address of data for the selected fifo. |
| 48 | |
| 49 | * `MWMR_CONFIG_RUNNING` |
| 50 | A boolean enabling the selected fifo. |
| 51 | |
| 52 | = Component usage = |
| 53 | |
| 54 | For extensibility issues, you should access the !MwmrController using globally-defined offsets. |
| 55 | |
| 56 | You should include file source:trunk/soclib/include/soclib/MwmrController.h from your software, it |
| 57 | defines all useful offsets and constants. |
| 58 | |
| 59 | Sample code: |
| 60 | |
| 61 | Please see source:trunk/soclib/platforms/mwmr/soft/mwmr.h and source:trunk/soclib/platforms/mwmr/soft/mwmr.c for reference implementation. |
| 62 | |
| 63 | (add -I/path/to/soclib/include to your compilation command-line) |
| 64 | |
| 65 | = Component definition = |
| 66 | |
| 67 | Available in source:trunk/soclib/desc/soclib/vci_mwmr_controller.sd |
| 68 | |
| 69 | == Usage == |
| 70 | |
| 71 | !VciMwmrController has two template parameters: VCI ones, and internal fifo maximum depth. It may be used like others, see [wiki:SoclibCc/VciParameters SoclibCc/VciParameters] |
| 72 | {{{ |
| 73 | Uses( 'vci_MwmrController', fifo_depth = 32, **vci_parameters ) |
| 74 | }}} |
| 75 | |
| 76 | = !VciMwmrController CABA Implementation = |
| 77 | |
| 78 | The caba implementation is in |
| 79 | * source:trunk/soclib/systemc/include/caba/target/vci_mwmr_controller.h |
| 80 | * source:trunk/soclib/systemc/src/caba/target/vci_mwmr_controller.cc |
| 81 | |
| 82 | == Template parameters: == |
| 83 | |
| 84 | * The VCI parameters |
| 85 | * The fifo depth |
| 86 | |
| 87 | == Constructor parameters == |
| 88 | {{{ |
| 89 | VciMwmrController( |
| 90 | sc_module_name name, |
| 91 | const IntTab &index, |
| 92 | const MappingTable &mt, |
| 93 | const size_t plaps, # Default timeout between two access retries to a given MWMR |
| 94 | const size_t n_to_coproc, # \ Cardinal of fifos |
| 95 | const size_t n_from_coproc,# / interfacing the coprocessor |
| 96 | const size_t n_config, # \ Cardinal of registers |
| 97 | const size_t n_status ); # / (sideband signals) |
| 98 | }}} |
| 99 | |
| 100 | == Ports == |
| 101 | |
| 102 | * sc_in<bool> '''p_resetn''' : Global system reset |
| 103 | * sc_in<bool> '''p_clk''' : Global system clock |
| 104 | * soclib::caba::!VciTarget<vci_param> '''p_vci_target''' : The VCI target port |
| 105 | * soclib::caba::!VciInitiator<vci_param> '''p_vci_initiator''' : The VCI initiator port |
| 106 | * soclib::caba::!FifoOutput<uint32_t> '''p_to_coproc[]''' : Fifos to coprocessor |
| 107 | * soclib::caba::!FifoInput<uint32_t> '''p_from_coproc[]''' : Fifos from coprocessor |
| 108 | * sc_out<uint32_t> '''p_config[]''' : Configuration ports |
| 109 | * sc_in<uint32_t> '''p_status[]''' : Status ports |
| 110 | |