| 1 | [wiki:Component SocLib Components General Index] |
| 2 | |
| 3 | = !VciLogConsole = |
| 4 | |
| 5 | == 1) Functional Description == |
| 6 | |
| 7 | This VCI target is a simple log sink, receiving any written |
| 8 | character and printing it to the external world. |
| 9 | |
| 10 | It only has one mapped register accepting only writes. |
| 11 | |
| 12 | A putc implementation could be: |
| 13 | {{{ |
| 14 | |
| 15 | static const volatile void* log_address = 0xc0000000; |
| 16 | |
| 17 | static inline void putc(const size_t term_no, const char x) |
| 18 | { |
| 19 | soclib_io_set( tty_address, 0, x ); |
| 20 | } |
| 21 | }}} |
| 22 | |
| 23 | == 2) Component definition & usage == |
| 24 | |
| 25 | source:trunk/soclib/soclib/module/connectivity_component/vci_log_console/caba/metadata/vci_log_console.sd |
| 26 | |
| 27 | See [wiki:SoclibCc/VciParameters SoclibCc/VciParameters] |
| 28 | {{{ |
| 29 | Uses( 'caba:vci_log_console', **vci_parameters ) |
| 30 | }}} |
| 31 | |
| 32 | == 3) CABA Implementation == |
| 33 | |
| 34 | === CABA sources === |
| 35 | |
| 36 | * interface : source:trunk/soclib/soclib/module/connectivity_component/vci_log_console/caba/source/include/vci_log_console.h |
| 37 | * implementation : source:trunk/soclib/soclib/module/connectivity_component/vci_log_console/caba/source/src/vci_log_console.cpp |
| 38 | |
| 39 | |
| 40 | === CABA Constructor parameters === |
| 41 | |
| 42 | {{{ |
| 43 | VciLogConsole( |
| 44 | sc_module_name name, // Instance name |
| 45 | const soclib::common::IntTab &index, // Target index |
| 46 | const soclib::common::MappingTable &mt) // Mapping Table |
| 47 | }}} |
| 48 | |
| 49 | Example instanciation: |
| 50 | {{{ |
| 51 | VciLogConsole tty("logger", |
| 52 | IntTab(2,3), |
| 53 | mapping_table ); |
| 54 | }}} |
| 55 | Note : the name list MUST be terminated by NULL. |
| 56 | |
| 57 | === CABA Ports === |
| 58 | |
| 59 | * sc_in<bool> '''p_resetn''' : Global system reset |
| 60 | * sc_in<bool> '''p_clk''' : Global system clock |
| 61 | * soclib::common::!VciiTarget<vci_param> '''p_vci''' : The VCI port |