[Discuss OpenCPI] Re: Unit testing with optional ports / testing failure conditions

From: <dwp_at_md1tech.co.uk>
Date: Fri, 02 Jun 23 09:19:12 +0000

Hi James,

Thanks this is exactly what I was looking for. I am running into some strange behaviour however which I assume is a bug.

I have split my test XML into 3 cases: (Used underscores for indentation as spaces get removed when I post)

`<Tests UseHDLFileIo='true'>`\
`__<Input port='in' script='generate.py'/>`\
`__<Case>`\
`____<Output port='outUChar' testOptional='true'/>`\
`____<Output port='outUShort' testOptional='true'/>`\
`____<Output port='outULong' script='verify.py'/>`\
`____<Property name='maxValueAfterScale' values='1000000'/>`\
`____<Property name='scalingStyle' values='log, linear, none'/>`\
`__</Case>`\
`__<Case>`\
`____<Output port='outUChar' testOptional='true'/>`\
`____<Output port='outUShort' script='verify.py'/>`\
`____<Output port='outULong' testOptional='true'/>`\
`____<Property name='maxValueAfterScale' values='10000'/>`\
`____<Property name='scalingStyle' values='log, linear'/>`\
`__</Case>`\
`__<Case>`\
`____<Output port='outUChar' script='verify.py'/>`\
`____<Output port='outUShort' testOptional='true'/>`\
`____<Output port='outULong' testOptional='true'/>`\
`____<Property name='maxValueAfterScale' values='100'/>`\
`____<Property name='scalingStyle' values='log, linear'/>`\
`__</Case>`\
`</Tests>`

The first two cases work fine, however the final case, when `outUChar` is connected, does not run and gives the error:

`Exiting for exception: `**`Error`**` parsing assembly xml string due to: No instance named "file_write_from_outULong" found`

Looking in the generated application XMLs, the first line generated is `<application done='file_write_from_outULong'>`

whereas for the other cases it is `<application done='cmplx_to_magnitude'>`.\
I have tried changing the order of cases and the order the output ports are listed but it still generates the same.

I just wanted to check I am not doing something wrong before I submit this as an issue on gitlab.

Thanks again for your help.\
Dan






Received on Fri Jun 02 2023 - 09:19:12 CDT

This archive was generated by hypermail 2.3.0 : Fri Jun 05 2026 - 08:45:25 CDT