Not applicable
Aug 28, 2014
12:36 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 28, 2014
12:36 PM
Hello everyone,
I have problem and I hope you can help me. I'm testing software using Aurix simulator and I don't understand one thing, below I have presented example:
I have a preprocessor constant (define) which is defined as follow: Function(a,b,c) Conut(a,b,c). Sub elements a,b,c have values as below:
a = 0x07
b = 0x02
c = 0x04
I need to compute a simple equation (look below) but there is a problem. When I compute this manually I get 0x00070204, but when I look into debuger I have value 0x0007020F. How it's possible to get F at end ? Perhaps this is a problem with simulator configuration. Please help. Values a,b,c are always the same (they are defines).
(((a&0xFFFF) << 16) | ((b&0xFF)) << 😎 | c&0xFF
I have problem and I hope you can help me. I'm testing software using Aurix simulator and I don't understand one thing, below I have presented example:
I have a preprocessor constant (define) which is defined as follow: Function(a,b,c) Conut(a,b,c). Sub elements a,b,c have values as below:
a = 0x07
b = 0x02
c = 0x04
I need to compute a simple equation (look below) but there is a problem. When I compute this manually I get 0x00070204, but when I look into debuger I have value 0x0007020F. How it's possible to get F at end ? Perhaps this is a problem with simulator configuration. Please help. Values a,b,c are always the same (they are defines).
(((a&0xFFFF) << 16) | ((b&0xFF)) << 😎 | c&0xFF
- Tags:
- IFX
8 Replies
Aug 28, 2014
12:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 28, 2014
12:43 PM
mib86 wrote:
I have problem and I hope you can help me. I'm testing software using Aurix simulator and I don't understand one thing, below I have presented example:
I have a preprocessor constant (define) which is defined as follow: Function(a,b,c) Conut(a,b,c). Sub elements a,b,c have values as below:
a = 0x07
b = 0x02
c = 0x04
I need to compute a simple equation (look below) but there is a problem. When I compute this manually I get 0x00070204, but when I look into debuger I have value 0x0007020F. How it's possible to get F at end ? Perhaps this is a problem with simulator configuration. Please help. Values a,b,c are always the same (they are defines).
(((a&0xFFFF) << 16) | ((b&0xFF)) << 😎 | c&0xFF
Looks like some parentheses are mismatched, and some are missing. Try this instead:
((a&0xFFFF) << 16) | ((b&0xFF) << 😎 | (c&0xFF)
If there's still trouble, post the full macro definition.
Not applicable
Aug 28, 2014
12:46 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 28, 2014
12:46 PM
@Neal Manson Perhaps I forgot to write them because I have this code in work but I will check it tommorow because there can be error in source code and brackets can make error. I didn't write this code I need to make unit tests in TESSY for this code. In addition do you think that such mistakes can be from wrong simulator configuration ? Or something else or I need to look mistake only in source code ?
Aug 28, 2014
01:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 28, 2014
01:24 PM
mib86 wrote:
@Neal Manson Perhaps I forgot to write them because I have this code in work but I will check it tommorow because there can be error in source code and brackets can make error. I didn't write this code I need to make unit tests in TESSY for this code. In addition do you think that such mistakes can be from wrong simulator configuration ? Or something else or I need to look mistake only in source code ?
It doesn't sound like anything too complex to throw off the simulator, but let's see the specifics.
Not applicable
Aug 28, 2014
01:28 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 28, 2014
01:28 PM
Tommorow I will paste exact piece of code because now I can write somehing wrong. I can also upload my configuration if it will be needed
Not applicable
Aug 28, 2014
11:01 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 28, 2014
11:01 PM
mib86 wrote:
Tommorow I will paste exact piece of code because now I can write somehing wrong. I can also upload my configuration if it will be needed
Below I pasted original code
#define ERROR_CODE(TTID, GRP, EID) ( (Sl_TstRsltType)(((((uint32)TTID) & (uint32)0xFFFF) << 16U) | ((((uint32)GRP) & (uint32)0xFF) << 8U) | ((((uint32)EID) & (uint32)0xFF))) )
TTID = 0x07
GRP = 0x02
EID = 0x04
Sl_TstRsltType is a unsigned long type. I'm doing tests on 64 bit unit.
Aug 29, 2014
05:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 29, 2014
05:47 AM
Works fine for me with Tasking v4.3r3 - that is, x is 0x070204:
Could you show how you're actually invoking the macro?
x = ERROR_CODE( 7, 2, 4 );
Using Debug Target Configuration:
Target: TriCore 1.6.X Instruction Set Simulator - Production Device
Selected CPU type: tc23x
Register file: C:/Program Files/TASKING/TriCore v4.3r3/ctc/include/sfr/regtc23x.sfr
Communication: TSIM1 Simulator
Debug Instrument Module: tsim16p_e
Using Java Link Version 1.119
Starting Debugger...
TASKING VX-toolset for TriCore: debugger, Build 239.2.13
Copyright 2006-2014 Altium BV
Launching configuration: sim
Loading application "C:\Users\manson\workspace_ctc_v4.3r1\sim\Debug\sim.elf"...
Could you show how you're actually invoking the macro?
Not applicable
Aug 29, 2014
06:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 29, 2014
06:08 AM
Neal Manson wrote:
Works fine for me with Tasking v4.3r3 - that is, x is 0x070204:
Could you show how you're actually invoking the macro?
I'm using it in that way
TRAPTST_SMU_CLRALMSTSERR = ERROR_CODE((Sl_ErrorTstTypeIdType)TRAP_TESTTYPE_ID, ERROR_GRP_SMU, EID_CLRALMSTSERR)
I'm using TASKING VX-toolset for TriCore v4.2r2. Perhaps you have newer version and I need backup. I get same value as you but when I'm making unit tests in TESSY after code execution I recieve 0x07020F 😞
Aug 29, 2014
11:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 29, 2014
11:53 AM
mib86 wrote:
I'm using it in that wayTRAPTST_SMU_CLRALMSTSERR = ERROR_CODE((Sl_ErrorTstTypeIdType)TRAP_TESTTYPE_ID, ERROR_GRP_SMU, EID_CLRALMSTSERR)
I'm using TASKING VX-toolset for TriCore v4.2r2. Perhaps you have newer version and I need backup. I get same value as you but when I'm making unit tests in TESSY after code execution I recieve 0x07020F 😞
I doubt the simulator has changed in a long time.
Your example doesn't tell the whole story though - can you include all of the declarations and definitions necessary for the single line of code you listed to compile?