This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

What does the word UNPREDICTABLE exactly mean and what is its effect on the system?

Hi,

In many of ARM documentation result of operations are reported as unpredictable in some situations. For example, "If the system includes the Security Extensions, accesses to CNTVOFF from Secure Monitor mode are UNPREDICTABLE." what does the word UNPREDICTABLE exactly mean and what is its effect on the system? would that causes an exception and system switch to a certain mode?

Many thanks.

Parents
  • daith's answer is correct. I'd like to add an example of something that could be unpredictable.

    A chip manufacturer creates a microcontroller with 3 I/O-pins on Port A: PA[0], PA[1] and PA[2].

    In other words: Those are the low 3 bits of Port A.

    The I/O port is 32-bit accessible, and when you write values to this I/O-port, you can read back the values you've written.

    The manufacturer says in the manual, that writing to bits 0..2 is allowed, but writing to bits 3...31 should be avoided, as doing so will produce an unpredictable result.

    You write a piece of test-code, and you find out that you can actually use this space to store some information.

    You've decided to write value 0x50000001 to save your settings in the high-nibble and turn off your LED on PA[0].

    Later, the microcontroller manufacturer decides to revise the chip and spend some 'unused' silicon for other things.

    They found some silicon from Port A that they could use, so after they've made the modification to their chip, writing any value to the high 28 bits will have no effect. Reading the value of the unused bits will just give you a 0.

    So if you now write 0xffffffff to Port A, and read the result, you'll get 0x00000007.

    That means: Your software that stored your settings in the top 4 bits will no longer work the way it used to.

    You didn't change the source-code, but the reason it no longer works is because you bought a new revision of the chip.

    -So when you meet the word "unpredictable", don't find out how you can 'abuse' the feature (unless it's just for your own personal test-purposes).

    The same applies to "reserved" (which is often found in hardware registers) and "deprecated" (which is often used in software/firmware libraries).

    In other words: "Unpredictable" means something like: "Behaviour not defined."

Reply
  • daith's answer is correct. I'd like to add an example of something that could be unpredictable.

    A chip manufacturer creates a microcontroller with 3 I/O-pins on Port A: PA[0], PA[1] and PA[2].

    In other words: Those are the low 3 bits of Port A.

    The I/O port is 32-bit accessible, and when you write values to this I/O-port, you can read back the values you've written.

    The manufacturer says in the manual, that writing to bits 0..2 is allowed, but writing to bits 3...31 should be avoided, as doing so will produce an unpredictable result.

    You write a piece of test-code, and you find out that you can actually use this space to store some information.

    You've decided to write value 0x50000001 to save your settings in the high-nibble and turn off your LED on PA[0].

    Later, the microcontroller manufacturer decides to revise the chip and spend some 'unused' silicon for other things.

    They found some silicon from Port A that they could use, so after they've made the modification to their chip, writing any value to the high 28 bits will have no effect. Reading the value of the unused bits will just give you a 0.

    So if you now write 0xffffffff to Port A, and read the result, you'll get 0x00000007.

    That means: Your software that stored your settings in the top 4 bits will no longer work the way it used to.

    You didn't change the source-code, but the reason it no longer works is because you bought a new revision of the chip.

    -So when you meet the word "unpredictable", don't find out how you can 'abuse' the feature (unless it's just for your own personal test-purposes).

    The same applies to "reserved" (which is often found in hardware registers) and "deprecated" (which is often used in software/firmware libraries).

    In other words: "Unpredictable" means something like: "Behaviour not defined."

Children
No data