我正在尝试设置一个工作流程,用于在Windows 7 64位上使用Cython和MinGW从Python 3.5.1代码生成.pyd和.exe文件.
我有一个简单的example.py文件:
def hello(x):
print("Hello",x)
if __name__=='__main__':
hello("World!")
Run Code Online (Sandbox Code Playgroud)
从SO上的其他线程,我得到了下面的Cython命令,它生成一个没有警告的.c文件.
cython --embed -o example.c example.py
Run Code Online (Sandbox Code Playgroud)
当我调用gcc时,我收到以下警告,并且不太清楚这些是否至关重要.
gcc -c -IC:\Python35\include -o example.o example.c
In file included from C:\Python35\include/Python.h:65:0,
from example.c:4:
C:\Python35\include/pytime.h:113:5: warning: 'struct timeval' declared inside pa
rameter list [enabled by default]
_PyTime_round_t round);
^
C:\Python35\include/pytime.h:113:5: warning: its scope is only this definition o
r declaration, which is probably not what you want [enabled by default]
C:\Python35\include/pytime.h:118:5: warning: 'struct timeval' declared inside pa
rameter list [enabled by default]
_PyTime_round_t …Run Code Online (Sandbox Code Playgroud) to_01在 VHDL-2008 中使用转换函数时,我遇到了一些意外的行为。我的期望是可以清楚地解释为高或低的向量位分别映射到“1”和“0”。剩余的向量位应转换为“0”位。然而,通过下面描述的代码,我将整个向量转换为全“0”。
这种行为正确吗?或者这是模拟器软件(ALDEC Riviera-PRO)中的错误?
是否有任何 IEEE 函数可以满足我的期望,或者我是否必须编写自己的函数来实现这一目标?
library ieee;
use ieee.std_logic_1164.all;
entity test_to_01 is
end entity test_to_01;
architecture rtl of test_to_01 is
signal s_test_in : std_logic_vector(8 downto 0) := "UX01ZWLH-";
signal s_test_out : std_logic_vector(8 downto 0);
begin
s_test_out <= to_01(s_test_in);
end architecture rtl;
Run Code Online (Sandbox Code Playgroud)