Guest
I am using VHDL-2002. I am working with code that violates the following mandate in the LRM: "The base type of the subtype indication of a shared variable declaration must be a protected type." (LRM 4.3.1.3)
My simulator (Aldec Active HDL) is letting it slide with a warning:
# Warning: COMP96_0564: pcie_bfm_for_vpx_combo_fpga_pcie_v6.vhd : (583, 10): Shared variable is not of a protected type. (IEEE Std 1076-2002, 4.3.1.3)
I actually prefer the behavior that the simulator allows (even though the LRM seems to be calling for a hard error). The reason is that I find in most cases my shared variables divide along two lines, (1) stuff that needs atomicity/mutual-exclusion and (2) stuff that is not susceptible to shared-variable update error--often because of conditions that have been established using the atomicity/mutual-exclusion aspects of the first category.
Hence, I find the introduction of protected types into VHDL to be valuable for the realization of category (1) but the requirement that all shared variables must be protected types to be very limiting and awkward relative to category (2).
So, what I am hoping to find out here is whether the behavior of letting shared variables that are not protected types get by with a mere warning is also the behavior of most other simulators. If so, I would consider this to be a default feature of VHDL and go ahead and, where appropriate, design solutions that use shared variables that are not of a protected type.
If you have thoughts on this and especially if you can report the behavior of specific simulators, I hope that you will respond to the thread. Thank you!
My simulator (Aldec Active HDL) is letting it slide with a warning:
# Warning: COMP96_0564: pcie_bfm_for_vpx_combo_fpga_pcie_v6.vhd : (583, 10): Shared variable is not of a protected type. (IEEE Std 1076-2002, 4.3.1.3)
I actually prefer the behavior that the simulator allows (even though the LRM seems to be calling for a hard error). The reason is that I find in most cases my shared variables divide along two lines, (1) stuff that needs atomicity/mutual-exclusion and (2) stuff that is not susceptible to shared-variable update error--often because of conditions that have been established using the atomicity/mutual-exclusion aspects of the first category.
Hence, I find the introduction of protected types into VHDL to be valuable for the realization of category (1) but the requirement that all shared variables must be protected types to be very limiting and awkward relative to category (2).
So, what I am hoping to find out here is whether the behavior of letting shared variables that are not protected types get by with a mere warning is also the behavior of most other simulators. If so, I would consider this to be a default feature of VHDL and go ahead and, where appropriate, design solutions that use shared variables that are not of a protected type.
If you have thoughts on this and especially if you can report the behavior of specific simulators, I hope that you will respond to the thread. Thank you!