Re: supported operators for Signal class

Oscar Daniel Diaz <[email protected]> Mon, 11 Apr 2016 15:46:44 -0500
Newsgroups gmane.comp.python.myhdl
Message-ID <[email protected]>
El Lun 11 Abr 2016 17:36:56 David Stanford escribió:
> I'm trying some tests converting python code to MyHDL code that generates
> real hardware. As a hardware designer, I know some of these tests are going
> to be foolish first steps to make, 

First of all, beware! You're doing conversion to generate real hardware. That 
means the sythesizable operand list is very limited. In particular, you cannot 
synthesize multiplications, divisions and powers (at least with common VHDL 
and Verilog synthesizers, possibly that won't be true with HLLs or High-Level 
Logic synthesizers).

If you're doing simulation only, you would be fine.

> Which leads to the question, what operand types ARE supported for Signals?
> This feels like an obvious question, but I can't seem to find an answer
> anywhere in the documentation.

In reality, the supported operands are related to the underlying type of the 
Signal object, in your example, that would be intbv. You can create Signals 
with int, or any other python data type.

Regarding the intbv type, you can check the source file _intbv.py, and look for 
the operand methods available[1]. I saw all implemented methods for integers, 
so an intbv should behave as an int (as the documentation say). 

[1] https://docs.python.org/2/reference/datamodel.html#emulating-numeric-types

> Am I searching poorly looking for a list of operators that works between
> signals, or does such a table not exist? Should it?

Due to the syhthesizable code restriction I can say addition, subtraction, 
logic (and, or, xor, not) and shifts are probably the only operands supported 
for conversion.

> Thanks,
> 
> Dave Stanford
> 
> 
> This e-mail and its attachments are intended only for the individual or
> entity to whom it is addressed and may contain information that is
> confidential, privileged, inside information, or subject to other
> restrictions on use or disclosure. Any unauthorized use, dissemination or
> copying of this transmission or the information in it is prohibited and may
> be unlawful. If you have received this transmission in error, please notify
> the sender immediately by return e-mail, and permanently delete or destroy
> this e-mail, any attachments, and all copies (digital or paper). Unless
> expressly stated in this e-mail, nothing in this message should be
> construed as a digital or electronic signature. For additional important
> disclaimers and disclosures regarding KCG’s products and services, please
> click on the following link:
 
> http://www.kcg.com/legal/global-disclosures
> ----------------------------------------------------------------------------
> -- Find and fix application performance issues faster with Applications
> Manager Applications Manager provides deep performance insights into
> multiple tiers of your business applications. It resolves application
> problems quickly and reduces your MTTR. Get your free trial!
> http://pubads.g.doubleclick.net/
> gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
> _______________________________________________
> myhdl-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/myhdl-list

-- 
Oscar Díaz
Key Fingerprint = 8D3D 5FC4 A48C 5404 24AC  F684 A42F CE7C 39C0 AC6B
gpg --keyserver subkeys.pgp.net --recv-keys A42FCE7C39C0AC6B

I recommend using OpenDocument Format
for daily use and exchange of documents.

http://www.fsf.org/campaigns/opendocument

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z

_______________________________________________
myhdl-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/myhdl-list
signature.asc (application/pgp-signature, 819 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAABCAAGBQJXDA00AAoJEKQvznw5wKxrHvEP/1SuZnf6uQcfuON48bad2GzV
AChdZMsbwW/dzwY7FWlI9Av9dpUTlvHMvByqXr/YCkeLdWE4MwZe/TwxZuqQ73Dt
sqV4GpZFu8DhlB4Ud9sAGgOfQlrTF6H/eWFmkeUW1mHU9TjMZQb8uRGLyWreL4q/
P/eWoqTa36fQdIptF1GEJvLI9U/p17RVstq2SqbG0kJOdpB1aFShMqePezEPR3F9
+x85tRu7y8CjL0q0sk7cjx7cRK5IO4sdtk2ZA32rbr6TNjngAtaQsn4ikrQjM3DD
mJKXpEcbul5kC24yZmMCcTldwqb6Fo4cYg8fMZ1XyQpBWHECy5lM5WPNOsSaLOzq
UP6lYWdrbL6tvIjirUcCcE1VyZhJrdWLwblyxtUjR6Rnd3vro4kP5UsANSf9Pzra
nmQX8NfyaE7VTeY+DvQ8UKW17EpyxxCMOXysl2nlV9hsCwZrROdA7xLoafjCVzO1
jTlONKiznJ9UUR6V7YZ/0Zf5QTOvaWZmjNU3inExs56zuO2uxdmCrTUpIS7Yy1Uk
6Ips4vYJmJ+ai0PA08xQVnIHY+NcT+/6d+FV+PhVtyiRgdgCxm0B0OMuX/qoULP/
Fr9MXpMAQ6La1Z+cT6kS/9CAVo02cz3UW2Ts3oJHKvZXBw++DJymHB+oBEiF6xMp
G4SBAD6/Kb8xOMwb7GWw
=B5Nw
-----END PGP SIGNATURE-----