Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
VHDL
stumped on syntax yet again!
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="rickman, post: 3523118"] Given that statement, how do I apply this when working with constrained integers... I have a function to perform a "shift" operation on an integer, function sllint (x, sh : natural) return natural is begin return x*(2**sh); end sllint; I am using it with a constrained integer, SIGNAL Addr : NibbInt; where subtype NibbInt is Integer range 0 to 2**4-1; usage, Addr <= sllint(Addr, CTPDATAWDTH) + to_nat(Scfg_Din); where Scfg_Din is an SLV (1 downto 0) and CTPDATAWDTH is an integer constant of 2. I am not clear on what happens when I shift the value of Addr left by 2 and significant bits extend beyond the defined range. I thought about defining an overloaded operator for shifting NibbInt which would use the mod operator, but you say the subtype won't be used for overloading. So it would just use the sllint operator defined for integer anyway. I don't want to have to pass into the function the range of the parameter. The usage of the function just gets too messy. I guess I could use an sllnib operator, but I would prefer not to have to pre- select the function and the compiler select it as an overloaded function. How am I looking at this wrong? Shouldn't I be able to do this? Rick [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
VHDL
stumped on syntax yet again!
Top