Jump to content
    

VHDL, что не так?

Помогите пожалуйста

 

entity pwcex is

port(

res: in std_logic;

clock: in std_logic;

);

end pwcex;

 

architecture pwcex_arch of pwcex is

signal del: std_logic_vector(1 downto 0);

begin

A: process(clock,res)

begin

if res='0' then

del <= "00";

elsif (clock'event and clock='0' ) then

del <= del + 1;

end if;

end process;

end pwcex_arch;

 

компилирую, выдает ошибки

Error (10500): VHDL syntax error at pwcex.vhd(9) near text ")"; expecting an identifier, or "constant", or "file", or "signal", or "variable"

Error (10500): VHDL syntax error at pwcex.vhd(28) near text "begin"; expecting an identifier ("begin" is a reserved keyword), or "constant", or "file", or "signal", or "variable"

Error: Quartus II Analysis & Synthesis was unsuccessful. 2 errors, 0 warnings

Info: Allocated 153 megabytes of memory during processing

Error: Processing ended: Fri Jun 12 22:30:08 2009

Error: Elapsed time: 00:00:03

Error: Quartus II Full Compilation was unsuccessful. 2 errors, 0 warnings

 

Все, сам разобрался...

 

entity pwcex is

port(

res: in std_logic;

clock: in std_logic; <--- ";" не надо!!!

);

end pwcex;

Edited by yagger

Share this post


Link to post
Share on other sites

Помогите пожалуйста

 

entity pwcex is

port(

res: in std_logic;

clock: in std_logic;

);

end pwcex;

 

architecture pwcex_arch of pwcex is

signal del: std_logic_vector(1 downto 0);

begin

A: process(clock,res)

begin

if res='0' then

del <= "00";

elsif (clock'event and clock='0' ) then

del <= del + 1;

end if;

end process;

end pwcex_arch;

 

компилирую, выдает ошибки

Error (10500): VHDL syntax error at pwcex.vhd(9) near text ")"; expecting an identifier, or "constant", or "file", or "signal", or "variable"

Error (10500): VHDL syntax error at pwcex.vhd(28) near text "begin"; expecting an identifier ("begin" is a reserved keyword), or "constant", or "file", or "signal", or "variable"

Error: Quartus II Analysis & Synthesis was unsuccessful. 2 errors, 0 warnings

Info: Allocated 153 megabytes of memory during processing

Error: Processing ended: Fri Jun 12 22:30:08 2009

Error: Elapsed time: 00:00:03

Error: Quartus II Full Compilation was unsuccessful. 2 errors, 0 warnings

 

Все, сам разобрался...

 

entity pwcex is

port(

res: in std_logic;

clock: in std_logic; <--- ";" не надо!!!

);

end pwcex;

 

 

Интересный счетчик получился :laughing:

Выходов у него нет....

Прям черная дыра

Share this post


Link to post
Share on other sites

Интересный счетчик получился :laughing:

Выходов у него нет....

Прям черная дыра

сори.

полный текст вот такой:

 

entity pwcex is

port(

res: in std_logic;

clock: in std_logic;

del_1: out std_logic_vector(1 downto 0)

);

end pwcex;

 

architecture pwcex_arch of pwcex is

 

signal del: std_logic_vector(1 downto 0);

 

begin

A: process(clock,res)

 

begin

if res='0' then

del <= "00";

elsif (clock'event and clock='0' ) then

 

del <= del + 1;

end if;

end process;

del_1 <= del;

 

end pwcex_arch;

 

но я в симуляторе сигналов на выводах del_1[0] и del_1[1] наблюдаю ХХХХХХХХХХХХХХХХХХХХХХХХ.... почему?

вроде ни на что не ругается... :crying:

Share this post


Link to post
Share on other sites

сори.

полный текст вот такой:

 

entity pwcex is

port(

res: in std_logic;

clock: in std_logic;

del_1: out std_logic_vector(1 downto 0)

);

end pwcex;

 

architecture pwcex_arch of pwcex is

 

signal del: std_logic_vector(1 downto 0);

 

begin

A: process(clock,res)

 

begin

if res='0' then

del <= "00";

elsif (clock'event and clock='0' ) then

 

del <= del + 1;

end if;

end process;

del_1 <= del;

 

end pwcex_arch;

 

но я в симуляторе сигналов на выводах del_1[0] и del_1[1] наблюдаю ХХХХХХХХХХХХХХХХХХХХХХХХ.... почему?

вроде ни на что не ругается... :crying:

 

Не телепат... Какой симулятор?

Где тестбенч?

Share this post


Link to post
Share on other sites

Не телепат... Какой симулятор?

Где тестбенч?

 

обана... это для меня пока абра кадабра...

 

в квартусе 7.2 что такое тест бенч? :laughing:

я в этом деле можно сказать только только начал, посему могу очень глупые вопросы задавать...

 

в квартусе, создал проект, написал вот ЭТО (см выше) ну правда со всеми подключениями библиотек, нажал компиляция...

Создал файл с расширением vwf и подключил его к этому же проекту, "проявил" в нем все сигналы что есть в описании,

входные сигналы клок (сделал мендр) а рес переход из 0 в 1 на первых 40 нСек...

потом в симулятор тул нажал Generate Functional Simulation Netlist, потом сверху кнопочку Start Simulation...

 

и все... на закладке с этим файлом, где графики сигналов нарисованы типа, выходные сигналы как были так и остались в виде ХХХХХХХХ... :laughing: Я их могу сам менять, но я так понимаю они должны меняться автоматически согласно описанию логики работы, согласно ВХОДНЫМ сигналам!?

 

Научите пжлст. :1111493779:

Edited by yagger

Share this post


Link to post
Share on other sites

обана... это для меня пока абра кадабра...

 

в квартусе 7.2 что такое тест бенч? :laughing:

я в этом деле можно сказать только только начал, посему могу очень глупые вопросы задавать...

 

в квартусе, создал проект, написал вот ЭТО (см выше) ну правда со всеми подключениями библиотек, нажал компиляция...

Создал файл с расширением vwf и подключил его к этому же проекту, "проявил" в нем все сигналы что есть в описании,

входные сигналы клок (сделал мендр) а рес переход из 0 в 1 на первых 40 нСек...

потом в симулятор тул нажал Generate Functional Simulation Netlist, потом сверху кнопочку Start Simulation...

 

и все... на закладке с этим файлом, где графики сигналов нарисованы типа, выходные сигналы как были так и остались в виде ХХХХХХХХ... :laughing: Я их могу сам менять, но я так понимаю они должны меняться автоматически согласно описанию логики работы, согласно ВХОДНЫМ сигналам!?

 

Научите пжлст. :1111493779:

 

С квартусом давно не работаю... на память не подскажу.

Вообще-то там есть туториалы... потратьте час-два на них - станет намного легче.

Это - хороший совет :-) Вы так сами научитесь.

Share this post


Link to post
Share on other sites

С квартусом давно не работаю... на память не подскажу.

Вообще-то там есть туториалы... потратьте час-два на них - станет намного легче.

Это - хороший совет :-) Вы так сами научитесь.

 

:wassat: спасибо...

Share this post


Link to post
Share on other sites

Вот так на Quartus 8.1 работает:

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;


entity pwcex is

port(
res: in std_logic;
clock: in std_logic;
del_1: out std_logic_vector(1 downto 0)
);
end pwcex;

architecture pwcex_arch of pwcex is

signal del: unsigned(1 downto 0);

begin
A: process(clock,res)

begin
if res='0' then
del <= "00";
elsif (clock'event and clock='0' ) then

del <= del + 1;
end if;
end process;
del_1 <= std_logic_vector(del);

end pwcex_arch;

 

yagger:

Два совета:

1) Приводить весь код полностью (при этом лучше воспользоваться тегом code).

2) Приводить список всех errors и warnings, которые выдал компилятор.

Share this post


Link to post
Share on other sites

на закладке с этим файлом, где графики сигналов нарисованы типа, выходные сигналы как были так и остались в виде ХХХХХХХХ...

 

Реакция на входные воэдействия по кнопке report

А если в опции open реакцию хотите увидеть, поставьте галочку overwrite simulation input file .......

Share this post


Link to post
Share on other sites

Большое спасибо, действительно заработало. :)

Буду дальше экспериментировать и учить...

Share this post


Link to post
Share on other sites

Попробовал вот так:

 

library ieee;

use ieee.std_logic_1164.all;

use ieee.numeric_std.all;

 

entity pwcex is

 

port(

res: in std_logic;

clock: in std_logic;

del_1: out std_logic_vector(1 downto 0)

);

end pwcex;

 

architecture pwcex_arch of pwcex is

 

signal del: std_logic_vector(1 downto 0);

 

begin

A: process(clock,res)

 

begin

if res='0' then

del <= "00";

elsif (clock'event and clock='0' ) then

 

del <= del + 1; --<--------Указывает ошибку вот сюда...

end if;

end process;

 

del_1 <= del(1 downto 0);

 

end pwcex_arch;

 

------------------------------------------------

Info: *******************************************************************

Info: Running Quartus II Analysis & Synthesis

Info: Version 7.2 Build 175 11/20/2007 Service Pack 1 SJ Full Version

Info: Processing started: Sun Jun 14 11:58:30 2009

Info: Command: quartus_map --read_settings_files=on --write_settings_files=off pwcex -c pwcex

Info: Found 2 design units, including 1 entities, in source file pwcex.vhd

Info: Found design unit 1: pwcex-pwcex_arch

Info: Found entity 1: pwcex

Error (10327): VHDL error at pwcex.vhd(27): can't determine definition of operator ""+"" -- found 0 possible definitions

Error: Quartus II Analysis & Synthesis was unsuccessful. 1 error, 0 warnings

Info: Allocated 153 megabytes of memory during processing

Error: Processing ended: Sun Jun 14 11:58:34 2009

Error: Elapsed time: 00:00:04

Error: Quartus II Full Compilation was unsuccessful. 1 error, 0 warnings

 

 

почему я не могу прибавить 1 к переменной del?

 

в верхнем примере с unsigned работает, а с std_logic_vector нет, почему?

Share this post


Link to post
Share on other sites

в верхнем примере с unsigned работает, а с std_logic_vector нет, почему?

 

Библиотеки ему не хватает типа use IEEE.STD_LOGIC_UNSIGNED.ALL;

скачайте с сайта xilinx докумет xst.pdf и по нему учитесь.

Без наставника по vhdl лучше c verilog начинать.

Share this post


Link to post
Share on other sites

Библиотеки ему не хватает типа use IEEE.STD_LOGIC_UNSIGNED.ALL;

скачайте с сайта xilinx докумет xst.pdf и по нему учитесь.

Без наставника по vhdl лучше c verilog начинать.

 

опа, точно. спасибо.

странно, но у меня эта библиотека была прописана сразу, а теперь смотрю прописана другая, при этом я ее не прописывал руками!!! а unsigned пропала сама почему то, точнее "заменилась" сама на нумерик... :unsure:

 

Гы, так вот я и нашел только в "лице" форума наставников!!! У нас с таковыми глушь, такое впечатление что вымерли все!!! Ни одного ни то что знакомого, даже НЕЗНАКОМОГО нет, кто с вшдл работает... да вообще с плисами мало кто возится... :unsure:

Share this post


Link to post
Share on other sites

yagger:

Скачайте книги по VHDL или Verilog(больше советую) и разбирайтесь - будет проще.

 

Вы опять не используете теги для оформления кода.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...