首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在VLSI中编译VHDL时出错

在VLSI中编译VHDL时出错
EN

Stack Overflow用户
提问于 2017-12-31 01:57:01
回答 1查看 149关注 0票数 0

我正在我的VLSI中创建一个CPU,从一个寄存器开始:

代码语言:javascript
复制
library ieee;   
use ieee.std_logic_1164.all;

package types is
    type BYTE is array (7 downto 0) of std_logic;
end types;

-- Have to use one file because of Electric's compiler
library ieee;
use ieee.std_logic_1164.all; use work.types.all;

entity reg8 is
    port (
        clock   : in std_logic;
        inc     : in std_logic;
        dec     : in std_logic;
        store   : in std_logic;
        input   : in BYTE;
        output  : out BYTE
    );
end reg8;

architecture rtl of reg8 is
    signal state : BYTE;
begin
    tick : process(clock) is
    begin
        if(rising_edge(clock)) then
            if inc = '1' then
                state(0) <= not state(0);
                state(1) <= state(0) xor state(1);
                state(2) <= (state(0) and state(1)) xor state(2);
                state(3) <= (state(0) and state(1) and state(2)) xor state(3);
                state(4) <= (state(0) and state(1) and state(2) and state(3)) xor state(4);
                state(5) <= (state(0) and state(1) and state(2) and state(3) and state(4)) xor state(5);
                state(6) <= (state(0) and state(1) and state(2) and state(3) and state(4) and state(5)) xor state(6);
                state(7) <= (state(0) and state(1) and state(2) and state(3) and state(4) and state(5) and state(6)) xor state(7);
            elsif dec = '1' then
                state(0) <= not state(0);
                state(1) <= state(0) xnor state(1);
                state(2) <= (state(0) or state(1)) xnor state(2);
                state(3) <= (state(0) or state(1) or state(2)) xnor state(3);
                state(4) <= (state(0) or state(1) or state(2) or state(3)) xnor state(4);
                state(5) <= (state(0) or state(1) or state(2) or state(3) or state(4)) xnor state(5);
                state(6) <= (state(0) or state(1) or state(2) or state(3) or state(4) or state(5)) xnor state(6);
                state(7) <= (state(0) or state(1) or state(2) or state(3) or state(4) or state(5) or state(6)) xnor state(7);
            elsif store = '1' then
                state <= input;
            end if;
        end if;
        output <= state;
    end process tick;
end architecture rtl;

而且我得到了语法检查器中不会发生的奇怪错误,比如为什么我需要一个进程的"PORT“关键字。

来自电气的完整日志:

代码语言:javascript
复制
Compiling VHDL in cell 'reg8{vhdl}' ...ERROR on line 25, Expecting keyword PORT:
tick : process(clock) is 
              ^
ERROR on line 25, Expecting keyword MAP:
tick : process(clock) is 
              ^
ERROR on line 25, Expecting a semicolon:
tick : process(clock) is 
                      ^
ERROR on line 26, Invalid ARCHITECTURAL statement:
begin 
^
ERROR on line 27, Expecting keyword END:
if(rising_edge(clock)) then 
^
ERROR on line 27, Expecting a semicolon:
if(rising_edge(clock)) then 
  ^
ERROR on line 27, No entry keyword - entity, architectural, behavioral:
if(rising_edge(clock)) then 
   ^
ERROR on line 27, No entry keyword - entity, architectural, behavioral:
if(rising_edge(clock)) then 
              ^
ERROR on line 27, No entry keyword - entity, architectural, behavioral:
if(rising_edge(clock)) then 
               ^
ERROR on line 27, No entry keyword - entity, architectural, behavioral:
if(rising_edge(clock)) then 
                    ^
ERROR on line 27, No entry keyword - entity, architectural, behavioral:
if(rising_edge(clock)) then 
                     ^
ERROR on line 27, No entry keyword - entity, architectural, behavioral:
if(rising_edge(clock)) then 
                       ^
ERROR on line 28, No entry keyword - entity, architectural, behavioral:
if inc = 11 then 
^
ERROR on line 28, No entry keyword - entity, architectural, behavioral:
if inc = 11 then 
   ^
ERROR on line 28, No entry keyword - entity, architectural, behavioral:
if inc = 11 then 
       ^
ERROR on line 28, No entry keyword - entity, architectural, behavioral:
if inc = 11 then 
         ^
ERROR on line 28, No entry keyword - entity, architectural, behavioral:
if inc = 11 then 
            ^
ERROR on line 29, No entry keyword - entity, architectural, behavioral:
state(0) <= not state(0); 
^
ERROR on line 29, No entry keyword - entity, architectural, behavioral:
state(0) <= not state(0); 
     ^
ERROR on line 29, No entry keyword - entity, architectural, behavioral:
state(0) <= not state(0); 
      ^
ERROR on line 29, No entry keyword - entity, architectural, behavioral:
state(0) <= not state(0); 
       ^
ERROR on line 29, No entry keyword - entity, architectural, behavioral:
state(0) <= not state(0); 
         ^
ERROR on line 29, No entry keyword - entity, architectural, behavioral:
state(0) <= not state(0); 
            ^
ERROR on line 29, No entry keyword - entity, architectural, behavioral:
state(0) <= not state(0); 
                ^
ERROR on line 29, No entry keyword - entity, architectural, behavioral:
state(0) <= not state(0); 
                     ^
ERROR on line 29, No entry keyword - entity, architectural, behavioral:
state(0) <= not state(0); 
                      ^
ERROR on line 29, No entry keyword - entity, architectural, behavioral:
state(0) <= not state(0); 
                       ^
ERROR on line 29, No entry keyword - entity, architectural, behavioral:
state(0) <= not state(0); 
                        ^
ERROR on line 30, No entry keyword - entity, architectural, behavioral:
state(1) <= state(0) xor state(1); 
^
TOO MANY ERRORS...PRINTING NO MORE

我使用的是Electric,可以在http://www.staticfreesoft.com/index.html上找到,如果有人想试一下的话。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-01-08 05:28:35

你问了,所以:

这似乎是“电气”,而不是一个通用的VHDL编译器。它只支持特定的子集和结构。也就是说,你试图做的事情可能不会奏效。您将需要切换到“更好的”(和付费的) ASIC综合工具,如Synopsys工具。

使用传统晶体管实现由ASIC编译器制作的电路可能需要大量晶体管。而且它甚至可能不会像预期的那样工作,因为ASIC设计程序大多需要非常具体的晶体管特性。使用(C)PLD或一些逻辑门芯片(7400系列)来实现您的设计会容易得多。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/48036484

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档