Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide more types in physical.vhdl #2

Open
cmarqu opened this issue Sep 16, 2016 · 5 comments
Open

Provide more types in physical.vhdl #2

cmarqu opened this issue Sep 16, 2016 · 5 comments

Comments

@cmarqu
Copy link

cmarqu commented Sep 16, 2016

physical.vhdl does not contain all physical types that are commonly used for e.g. modelling analog circuits, like voltage, current, resistance etc.
Maybe we should even mirror the VHDL-AMS packages and their types one-to-one, the list of which is at http://repo.or.cz/emacs.git/blob/HEAD:/lisp/progmodes/vhdl-mode.el#l5057

@cmarqu
Copy link
Author

cmarqu commented Sep 16, 2016

Also, having worked with my own physical types in the past, I have found that at least for currents, the range of values that can be expressed with integer'high is too limiting.
It has worked for me to "manually" specify a very high number somewhere near 2^64 (I don't have the code anymore), but that is probably highly simulator-specific (and probably also host-architecture specific, and whether you have a 32- or 64-bit executable).
Some configurability may be required - lacking a macro capability, maybe by generating files.

@Paebbels
Copy link
Member

Are voltages, currents, ... a digital problem or do we drift into the AMS world?

For my 3 proposed units:

  • freq - sometimes it's better to calculate in frequencies then in times/delays
  • baud - used for slow I/O controllers e.g. UART
  • memory - used to calculate addres ranges, caches, ...

Can use present use cases?

@cmarqu
Copy link
Author

cmarqu commented Sep 21, 2016

(Brief since I am limited to a phone)
In the ASIC world, when you have analog components, it's quite a big thing to use "real value modeling" (RNM) which does not do full AMS (ie. with an analog solver in the mix) but just uses the digital simulator for speed and less license costs. "Digital VHDL" was always able to transport reals over ports, but only Verilog-AMS (not using an analog code section) with the wreal port type and SystemVerilog 2012 can do that now too.
I would be modeling basically everything that is an analog schematic, be it sensors with a "mechanical" input (pressure) or temperature or capacitance etc. with voltage output, and of course amplifiers, bias current generators and ADCs too. And I want my models pin-compatible to the schematics.
Resolution functions for e.g. currents are summing up, for voltages you would produce Xes (unless their values match maybe).

@Paebbels
Copy link
Member

OK that makes sense. Would you implement all in one file or in multiple files? The currently proposed package is quite huge and it only covers 4 types (the 3 from above and extensions for time). Can we use a frontend package and split implementations across files? Maybe we should dig for the partial package proposal in P1076 :).

@cmarqu
Copy link
Author

cmarqu commented Sep 21, 2016

I'd mimic the separation of the "natures" in VHDL-AMS, and keep everything except the types themselves in _support packages I guess. Yes, they will be big, and they probably need to be generated in some way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants