AHDL graphic State Diagram and adding my own "type"

M

magik

Hi

I'm using AHDL and I want to create some memory (16x1byte) into my
state_machine. Exactly I want to add some functions to my merory and that is
why I need state machine. How can I do that in graphic State Diagram?? I can
add variable or signal just by click a button with the icon Variable/Signal
but how can I add my own type?

In text file it would be like this:

------------
type ram_mem_type is array (15 downto 0) of std_logic_vector (7 downto 0);
signal ram16x1 : ram_mem_type;
------------

I've got about 40 states and I just don't want to get lost while writing
text file...


thans for any help!!


Paul
 
M

Mariusz

magik said:
Hi

I'm using AHDL and I want to create some memory (16x1byte) into my
state_machine. Exactly I want to add some functions to my merory and that is
why I need state machine. How can I do that in graphic State Diagram?? I can
add variable or signal just by click a button with the icon Variable/Signal
but how can I add my own type?

In text file it would be like this:

------------
type ram_mem_type is array (15 downto 0) of std_logic_vector (7 downto 0);
signal ram16x1 : ram_mem_type;
------------

I've got about 40 states and I just don't want to get lost while writing
text file...


thans for any help!!


Paul
Paul,

You can define the ram_mem_type in a package e.g.

library ieee;
use ieee.std_logic_1164.all;

package my_type is
type ram_mem_type is array (15 downto 0) of std_logic_vector (7
downto 0);
end package;

Then, use the FSM menu to invoke Code Generation Settings where on the
Design Unit Header tab you can add your package:

use work.my_type.all;

Once you do the above, you can use the 'User defined' field in the
Signal Properties dialog the signal you need to declare in order to
create the memory.

Regards,
Mariusz
 
M

magik

Dzieki Mariusz!


Przejdzmy na jezyk polski.
Jak to jest: piszac w pliku tekstowym, moge dodac sobie taka pamiec bez
niczego i korzystac z niej bezposrednio wywolujac kazda komorke wg
uznania. Np. memory(4)(3) <= '1'.Natomiast nie potrafie dodac takiej pamieci
do procesu jesli buduje
maszyne stanow w graficznym edytorze AHDL.w pliku tekstowym robie cos
takiego: architecture
begin
process(clk)
beginif rising_edge(clk) then
----
if WR = '1'
mem(conv_integer(adres_z_zewnatrz)) <= dane_z_zewnatrz_WR;
elsif RD = '1'
dane_na_zewnatrz <= mem(conv_integer(adres_z_zewnatrz));
end if;
----- -----
if ...
maszyna stanow z korzystaniem z mem()() a w niej na przyklad cos
takiego: "jakis stan"
if WR = '0' and RD = '0' then
mem(2)(3) <= wejscie_A;
end if;
end if;
----end if;
end process;
end architecture;i moge w maszynie robic wewnetrzne operacje na
pamieci.Zrobilem cos odwrotnego - napisalem taka maszyne i skorzystalem z
opcji Code2Graphic w AHDLu i nie poradzil sobie z tak okreslonym
procesem...Natomiast zrobienie 2 procesow i korzystanie z jednej pamieci nie
dziala mi tak...To co mi proponujesz to chyba wklejanie z package gotowego
interfejsu wczesniej zbudowanej pamieci. Ale czy to nie jest tylko
odczyt/zapis zewnetrzny w pamieci (korzystanie z linii adres/dane(we/wy) ??A
ja chce jeszcze na tej pamieci wewnatrz maszyny stanow cos zrobic...Pawel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top