| 1 | = Description = |
| 2 | |
| 3 | [[Image(VciLocks.png, align=right)]] |
| 4 | |
| 5 | This VCI target is an hardware semaphore helper. |
| 6 | |
| 7 | VCI-based systems may have some difficulties implementing proper locking of target components |
| 8 | as this can be done on buses. As a side-effect, locks and other atomic-access-based |
| 9 | software resources can't be used. This component solves this problem implementing the |
| 10 | atomic-access-like features on target side. |
| 11 | |
| 12 | This components has one bit of information stored on each 32-bit addressable word: |
| 13 | * When read, its current value is returned, and it is implicitly set to 1 |
| 14 | * When written to, it is reset to 0. |
| 15 | |
| 16 | This way: |
| 17 | * A spin lock is a simple loop waiting to read 0 |
| 18 | * Releasing the lock is a simple write operation |
| 19 | |
| 20 | = Implementations = |
| 21 | |
| 22 | == Caba implementation == |
| 23 | |
| 24 | The caba implementation is in |
| 25 | * source:trunk/soclib/systemc/include/caba/target/vci_locks.h |
| 26 | * source:trunk/soclib/systemc/src/caba/target/vci_locks.cc |
| 27 | |
| 28 | Template parameters: |
| 29 | * The VCI parameters |
| 30 | |
| 31 | Instanciation parameters |
| 32 | * Name |
| 33 | * Target's index |
| 34 | * MappingTable reference |
| 35 | |
| 36 | Ports |
| 37 | * p_vci: the VCI port |
| 38 | * p_resetn: Global system reset |
| 39 | * p_clk: Global system clock |