| 1 | [wiki:Component SocLib Components General Index] |
| 2 | |
| 3 | = !VciSimpleRam = |
| 4 | |
| 5 | == 1) Functional Description == |
| 6 | |
| 7 | This VCI target is an embedded SRAM controller. This hardware component handles |
| 8 | independent memory segments. Each segment is defined by a base address and a size (number of bytes). |
| 9 | Both the base and the size parameters must be multiple of 4. |
| 10 | The segments allocated to a given instance of this component are defined in the [wiki:Component/MappingTable Mapping Table]. |
| 11 | |
| 12 | Each segment is implemented as a dynamically allocated array in the constructor. |
| 13 | |
| 14 | As the !VciRam component, the !VciSimpleRam component initializes its segments from a ELF binary if a |
| 15 | [wiki:Component/Loader Loader] is attached to it. |
| 16 | |
| 17 | == 2) Component definition & usage == |
| 18 | |
| 19 | source:trunk/soclib/soclib/module/internal_component/vci_simple_ram/caba/metadata/vci_simple_ram.sd |
| 20 | |
| 21 | See [wiki:SoclibCc/VciParameters SoclibCc/VciParameters] |
| 22 | {{{ |
| 23 | Uses( 'vci_simple_ram', **vci_parameters ) |
| 24 | }}} |
| 25 | |
| 26 | == 3) CABA Implementation == |
| 27 | |
| 28 | === CABA sources === |
| 29 | |
| 30 | * interface : source:trunk/soclib/soclib/module/internal_component/vci_simple_ram/caba/source/include/vci_simple_ram.h |
| 31 | * implementation : source:trunk/soclib/soclib/module/internal_component/vci_simple_ram/caba/source/src/vci_simple_ram.cpp |
| 32 | |
| 33 | === CABA Constructor parameters === |
| 34 | |
| 35 | * Uninitialized !VciSimpleRam |
| 36 | {{{ |
| 37 | VciSimpleRam( |
| 38 | sc_module_name name, // Instance name |
| 39 | const soclib::common::IntTab &index, // Target index |
| 40 | const soclib::common::MappingTable &mt) // Mapping Table |
| 41 | }}} |
| 42 | |
| 43 | * Elf-Initialized !VciSimpleRam |
| 44 | You may load a binary file, by creating a loader: |
| 45 | {{{ |
| 46 | soclib::common::Loader loader( "a.out" ); |
| 47 | VciSimpleRam( |
| 48 | sc_module_name name, // Instance name |
| 49 | const soclib::common::IntTab &index, // Target index |
| 50 | const soclib::common::MappingTable &mt, // Mapping Table |
| 51 | soclib::common::Loader &loader); // Loader |
| 52 | }}} |
| 53 | On reset, any loadable segment in ELF file will be reloaded |
| 54 | . |
| 55 | === CABA Ports === |
| 56 | |
| 57 | * sc_in<bool> '''p_resetn''' : hardware reset |
| 58 | * sc_in<bool> '''p_clk''' : clock |
| 59 | * soclib::common::!VciTarget<vci_param> '''p_vci''' : The VCI port |
| 60 | |
| 61 | |
| 62 | == 4) TLM-DT Implementation == |
| 63 | |
| 64 | === TLM-DT sources === |
| 65 | |
| 66 | * interface : source:trunk/soclib/soclib/module/internal_component/vci_simple_ram/tlmdt/source/include/vci_simple_ram.h |
| 67 | * implementation : source:trunk/soclib/soclib/module/internal_component/vci_simple_ram/tlmdt/source/src/vci_simple_ram.cpp |
| 68 | |
| 69 | === TLM-DT Constructor parameters === |
| 70 | {{{ |
| 71 | VciSimpleRam( |
| 72 | sc_module_name name, // Instance name |
| 73 | const soclib::common::IntTab &index, // Target index |
| 74 | const soclib::common::MappingTable &mt, // Mapping Table |
| 75 | soclib::common::Loader &loader); // Loader |
| 76 | }}} |
| 77 | |
| 78 | === TLM-DT Ports === |
| 79 | |
| 80 | * soclib::tlmdt::!VciTarget<vci_param> '''p_vci''' : The VCI port |
| 81 | |