mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-14 15:26:52 -04:00
some cleanup
This commit is contained in:
parent
812302bcf7
commit
57228748d4
@ -12,7 +12,7 @@ entity DIG_Counter is
|
|||||||
clr: in std_logic );
|
clr: in std_logic );
|
||||||
end DIG_Counter;
|
end DIG_Counter;
|
||||||
|
|
||||||
architecture DIG_Counter_arch of DIG_Counter is
|
architecture Behavioral of DIG_Counter is
|
||||||
signal count : std_logic_vector((Bits-1) downto 0) := (others => '0');
|
signal count : std_logic_vector((Bits-1) downto 0) := (others => '0');
|
||||||
begin
|
begin
|
||||||
process (C, clr, en)
|
process (C, clr, en)
|
||||||
@ -28,4 +28,4 @@ begin
|
|||||||
|
|
||||||
p_out <= count;
|
p_out <= count;
|
||||||
ovf <= en when count = ((2**Bits)-1) else '0';
|
ovf <= en when count = ((2**Bits)-1) else '0';
|
||||||
end DIG_Counter_arch;
|
end Behavioral;
|
@ -20,9 +20,9 @@ entity <?=entityName?> is
|
|||||||
p_in: in <?= vhdl.genericType(elem.Bits)?> );
|
p_in: in <?= vhdl.genericType(elem.Bits)?> );
|
||||||
end <?=entityName?>;
|
end <?=entityName?>;
|
||||||
|
|
||||||
architecture <?=entityName?>_arch of <?=entityName?> is
|
architecture Behavioral of <?=entityName?> is
|
||||||
begin
|
begin
|
||||||
<?- for (i:=0;i<outputs;i++) {?>
|
<?- for (i:=0;i<outputs;i++) {?>
|
||||||
out_<?=i?> <= p_in when sel = <?= vhdl.value(i,elem.'Selector Bits')?> else <?= vhdl.zero(elem.Bits)?>;
|
out_<?=i?> <= p_in when sel = <?= vhdl.value(i,elem.'Selector Bits')?> else <?= vhdl.zero(elem.Bits)?>;
|
||||||
<?- } ?>
|
<?- } ?>
|
||||||
end <?=entityName?>_arch;
|
end Behavioral;
|
||||||
|
@ -1,23 +0,0 @@
|
|||||||
LIBRARY ieee;
|
|
||||||
USE ieee.std_logic_1164.all;
|
|
||||||
|
|
||||||
<?
|
|
||||||
if (elem.Bits=1)
|
|
||||||
entityName:="NOT_GATE";
|
|
||||||
else
|
|
||||||
entityName:="NOT_GATE_BUS";
|
|
||||||
?>
|
|
||||||
|
|
||||||
entity <?=entityName?> is
|
|
||||||
<?vhdl.beginGenericPort();?>
|
|
||||||
<?if (elem.Bits>1) {?>generic ( Bits : integer );<?vhdl.registerGeneric("Bits"); }?>
|
|
||||||
port (
|
|
||||||
PORT_out: out <?=vhdl.genericType(elem.Bits)?>;
|
|
||||||
PORT_in: in <?=vhdl.genericType(elem.Bits)?> );
|
|
||||||
<?vhdl.endGenericPort();?>
|
|
||||||
end <?=entityName?>;
|
|
||||||
|
|
||||||
architecture <?=entityName?>_arch of <?=entityName?> is
|
|
||||||
begin
|
|
||||||
PORT_out <= NOT( PORT_in );
|
|
||||||
end <?=entityName?>_arch;
|
|
@ -1,46 +0,0 @@
|
|||||||
LIBRARY ieee;
|
|
||||||
USE ieee.std_logic_1164.all;
|
|
||||||
<?
|
|
||||||
|
|
||||||
if (param.inv)
|
|
||||||
entityName:="N"+param.op;
|
|
||||||
else
|
|
||||||
entityName:=param.op;
|
|
||||||
|
|
||||||
if (elem.Bits=1)
|
|
||||||
entityName=entityName+"_GATE_"+elem.Inputs;
|
|
||||||
else
|
|
||||||
entityName=entityName+"_GATE_BUS_"+elem.Inputs;
|
|
||||||
|
|
||||||
?>
|
|
||||||
entity <?=entityName?> is
|
|
||||||
<?vhdl.beginGenericPort();?>
|
|
||||||
<?if (elem.Bits>1) {?>generic ( Bits : integer );<?vhdl.registerGeneric("Bits"); }?>
|
|
||||||
port (
|
|
||||||
PORT_out: out <?=vhdl.genericType(elem.Bits)?>;
|
|
||||||
<? for (i:=0;i<elem.Inputs;i++) { ?>
|
|
||||||
PORT_In_<?=i+1?>: in <?
|
|
||||||
print(vhdl.genericType(elem.Bits));
|
|
||||||
if (i=elem.Inputs-1) print(" )");
|
|
||||||
?>;
|
|
||||||
<? } ?>
|
|
||||||
<?vhdl.endGenericPort();?>
|
|
||||||
end <?=entityName?>;
|
|
||||||
architecture <?=entityName?>_arch of <?=entityName?> is
|
|
||||||
begin
|
|
||||||
PORT_out <= <?
|
|
||||||
|
|
||||||
if (param.inv)
|
|
||||||
print("NOT (");
|
|
||||||
|
|
||||||
for (i:=0;i<elem.Inputs;i++) {
|
|
||||||
print("PORT_In_",i+1);
|
|
||||||
if (i<elem.Inputs-1)
|
|
||||||
print(" ",param.op," ");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (param.inv)
|
|
||||||
print(" )");
|
|
||||||
|
|
||||||
?>;
|
|
||||||
end <?=entityName?>_arch;
|
|
@ -17,7 +17,7 @@ entity DIG_RAMDualAccess is
|
|||||||
n2A: in std_logic_vector ((AddrBits-1) downto 0) );
|
n2A: in std_logic_vector ((AddrBits-1) downto 0) );
|
||||||
end DIG_RAMDualAccess;
|
end DIG_RAMDualAccess;
|
||||||
|
|
||||||
architecture DIG_RAMDualAccess_arch of DIG_RAMDualAccess is
|
architecture Behavioral of DIG_RAMDualAccess is
|
||||||
-- CAUTION: uses distributed RAM
|
-- CAUTION: uses distributed RAM
|
||||||
type memoryType is array(0 to (2**AddrBits)-1) of STD_LOGIC_VECTOR((Bits-1) downto 0);
|
type memoryType is array(0 to (2**AddrBits)-1) of STD_LOGIC_VECTOR((Bits-1) downto 0);
|
||||||
signal memory : memoryType;
|
signal memory : memoryType;
|
||||||
@ -30,4 +30,4 @@ begin
|
|||||||
end process;
|
end process;
|
||||||
n1D <= memory(to_integer(unsigned(n1A))) when ld='1' else (others => 'Z');
|
n1D <= memory(to_integer(unsigned(n1A))) when ld='1' else (others => 'Z');
|
||||||
n2D <= memory(to_integer(unsigned(n2A)));
|
n2D <= memory(to_integer(unsigned(n2A)));
|
||||||
end DIG_RAMDualAccess_arch;
|
end Behavioral;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user