Skip to content
Snippets Groups Projects
Commit 095b65af authored by Dominik Loidolt's avatar Dominik Loidolt
Browse files

-last_info option: skip model transfer if last updated model buffer and the...

-last_info option: skip model transfer if last updated model buffer and the current model buffer overlap exactly·
parent bbe42b58
Branches
Tags
No related merge requests found
......@@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.
## [Unreleased]
### Added
- add -vv flag for extra verbose output
###Changed
- -last_info option: skip model transfer if last updated model buffer and the current model buffer overlap exactly
## [0.11] - 26-04-2023
### Added
......@@ -12,7 +14,7 @@ All notable changes to this project will be documented in this file.
- add tests for the compression entity
- add test for cmp_rdcu_cfg.c
- add sparc inttypes.h definitions
###Changed
### Changed
- refactor function and constants names
- refactor configure check functions
- move the rdcu setup functions to cmp_rdcu_cfg.c
......@@ -31,7 +33,7 @@ All notable changes to this project will be documented in this file.
- functions to create and configure a compression configuration
- add max_used_bits feature
- add max used bit version field to the compression entity
###Changed
### Changed
- Change the build system form make to meson
- Change DEFAULT_CFG_MODEL and DEFAULT_CFG_DIFF to CMP_DIF_XXX constants
### Fixed
......
......@@ -509,26 +509,31 @@ int rdcu_compress_data_parallel(const struct cmp_cfg *cfg,
/* read model and write model in parallel */
if (cfg->model_buf && model_mode_is_used(cfg->cmp_mode) && model_mode_is_used(last_info->cmp_mode_used)) {
uint32_t new_model_size_4byte;
if (cfg->rdcu_model_adr == last_info->rdcu_new_model_adr_used &&
cfg->samples == last_info->samples_used) {
printf("The last updated model buffer and the current model buffer overlap exactly in the SRAM of the RDCU. Skip model transfer.\n");
} else {
uint32_t new_model_size_4byte;
/* set the model in the local mirror... */
if (rdcu_write_sram_16(cfg->model_buf, cfg->rdcu_model_adr,
cfg->samples * IMA_SAM2BYT) < 0)
return -1;
/* set the model in the local mirror... */
if (rdcu_write_sram_16(cfg->model_buf, cfg->rdcu_model_adr,
cfg->samples * IMA_SAM2BYT) < 0)
return -1;
new_model_size_4byte = last_info->samples_used * IMA_SAM2BYT;
if (rdcu_sync_sram_mirror_parallel(last_info->rdcu_new_model_adr_used,
(new_model_size_4byte+3) & ~0x3U,
cfg->rdcu_model_adr,
samples_4byte, rdcu_get_data_mtu()))
return -1;
/* wait for it */
sync();
if (cfg->icu_new_model_buf) {
if (rdcu_read_sram(cfg->icu_new_model_buf,
last_info->rdcu_new_model_adr_used,
new_model_size_4byte) < 0)
new_model_size_4byte = last_info->samples_used * IMA_SAM2BYT;
if (rdcu_sync_sram_mirror_parallel(last_info->rdcu_new_model_adr_used,
(new_model_size_4byte+3) & ~0x3U,
cfg->rdcu_model_adr,
samples_4byte, rdcu_get_data_mtu()))
return -1;
/* wait for it */
sync();
if (cfg->icu_new_model_buf) {
if (rdcu_read_sram(cfg->icu_new_model_buf,
last_info->rdcu_new_model_adr_used,
new_model_size_4byte) < 0)
return -1;
}
}
/* write model */
} else if (cfg->model_buf && model_mode_is_used(cfg->cmp_mode)) {
......
......@@ -2439,8 +2439,11 @@ int rdcu_sync_sram_mirror_parallel(uint32_t rx_addr, uint32_t rx_size,
return -1;
/* check buffer overlap */
if (rx_addr < tx_addr+tx_size && rx_addr+rx_size > tx_addr)
if (rx_addr < tx_addr+tx_size && rx_addr+rx_size > tx_addr) {
printf("Error: The two parallel transferring buffers overlap. Read buffer: 0x%x size: %u. Write buffer: 0x%x size: %u.\n",
rx_addr, rx_size, tx_addr, tx_size);
return -1;
}
rx_bytes = rx_size;
......
project('cmp_tool', 'c',
version : '0.11',
version : '0.11-b1',
meson_version : '>= 0.56',
license : 'GPL-2.0',
default_options : ['warning_level=3', 'c_std=gnu99']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment