Issue #538
Mac OSX data types
| Status: | NoFixNeeded | Start date: | 07/26/2012 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | Wilson Snyder | % Done: | 0% |
|
| Category: | Configure/Make/Compiling | |||
| Target version: | - |
Description
I routinely use verilator on my macbook pro. So thank you for making it available, and it is great to be able to say that :)
I just upgraded to verilator-3.833 and realized that there were/are two issues that can happen with regard to uint64_t on mac osx. Fundamentally, it is because mac uses "unsigned long long" to mean uint64_t (i.e. as opposed to "unsigned long").
Here are the edits that I had to do to make it work:2012-07-26 [.../verilator-3.833/include] $> diff verilatedos.h /usr/local/share/verilator/include/verilatedos.h 167c167 < typedef unsigned long vluint64_t; ///< 64-bit unsigned type --- > typedef unsigned long long vluint64_t; ///< 64-bit unsigned typeand
2012-07-26 [.../verilator-3.833/include] $> diff vltstd/svdpi.h /usr/local/share/verilator/include/vltstd/svdpi.h 19c19 < --- > #include <stdint.h>
obviously this is a hack, but, if you would be willing to fix this, I can clone the repo and re-test the re-build :)
History
Updated by Wilson Snyder 10 months ago
- Category set to Configure/Make/Compiling
- Status changed from New to Assigned
- Assignee set to Wilson Snyder
There were some Mac issues fixed in the git version, though I'm not sure about that one. Please give it a try.
While I'm sure "long long" fixes your machine, obviously others need to work too. I've had to apply several patches from other folks in this area, so if you could find a definitive source of how to properly do it that would be appreciated. The logic now looks for __WORDSIZE == 64, which I thought was correct. BTW it can't use configure nor uint64_t as that is not always defined.
Updated by Joe Eiler 10 months ago
I suggested the __WORDSIZE a couple years ago, before I did I checked on a mac and __WORDSIZE was getting defined in stdint.h IIRC. I don't have access to a mac right now but you might want to check the stdint include file to see what they are keying off. You might also want to look at limits.h (FYI, linux does it in an included bits/wordsize.h)
Odd, the way your diff looks it appears your system must have WORDSIZE defined to 64 (or you would have fallen to the #else and gotten the 32bit wordsize you wanted). I would say it could maybe try to look at __LP64 but that is really compiler dependent and verilator has things broken up nicely by OS.
Updated by Wilson Snyder 4 months ago
- Status changed from Assigned to NoFixNeeded
Closing as workaround found.
Also available in: Atom
![[logo]](/img/veripool_small.png)