diff --git a/RELEASENOTES-1.4.md b/RELEASENOTES-1.4.md index 9bf0b7c3..06d97d70 100644 --- a/RELEASENOTES-1.4.md +++ b/RELEASENOTES-1.4.md @@ -359,3 +359,5 @@ - `note 6` Improved the log messages that are output by default for partial register accesses (fixes [#356](https://github.com/intel/device-modeling-language/issues/356)). - `release 6 6385` - `release 7 7080` +- `note 6` The `map_target` template from `utility.dml` now frees the internally + created map target when the object instantiating the template is deleted. diff --git a/lib/1.4/utility.dml b/lib/1.4/utility.dml index f1a17f0a..7181fd46 100644 --- a/lib/1.4/utility.dml +++ b/lib/1.4/utility.dml @@ -1238,7 +1238,7 @@ template bank_obj is (bank, name) { The template defines the following methods: */ -template map_target is (connect, _qname) { +template map_target is (connect, _qname, destroy) { session map_target_t *map_target; interface ram { param required = false; } @@ -1272,6 +1272,11 @@ template map_target is (connect, _qname) { this.map_target = obj ? SIM_new_map_target(obj, NULL, NULL) : NULL; } + method destroy() default { + SIM_free_map_target(this.map_target); + this.map_target = NULL; + } + /** * `read(uint64 addr, uint64 size) -> (uint64) throws`