Line 284... |
Line 284... |
fprintf(fp_out, " clk : in std_logic;\n");
|
fprintf(fp_out, " clk : in std_logic;\n");
|
fprintf(fp_out, " rst : in std_logic;\n");
|
fprintf(fp_out, " rst : in std_logic;\n");
|
fprintf(fp_out, " cs : in std_logic;\n");
|
fprintf(fp_out, " cs : in std_logic;\n");
|
fprintf(fp_out, " rw : in std_logic;\n");
|
fprintf(fp_out, " rw : in std_logic;\n");
|
fprintf(fp_out, " addr : in std_logic_vector(%d downto 0);\n", addr_len);
|
fprintf(fp_out, " addr : in std_logic_vector(%d downto 0);\n", addr_len);
|
fprintf(fp_out, " rdata : out std_logic_vector(7 downto 0);\n");
|
fprintf(fp_out, " data_out : out std_logic_vector(7 downto 0);\n");
|
fprintf(fp_out, " wdata : in std_logic_vector(7 downto 0)\n");
|
fprintf(fp_out, " data_in : in std_logic_vector(7 downto 0)\n");
|
fprintf(fp_out, " );\n");
|
fprintf(fp_out, " );\n");
|
fprintf(fp_out, "end %s;\n", entity_name);
|
fprintf(fp_out, "end %s;\n", entity_name);
|
fprintf(fp_out, "\n");
|
fprintf(fp_out, "\n");
|
fprintf(fp_out, "architecture rtl of %s is\n", entity_name);
|
fprintf(fp_out, "architecture rtl of %s is\n", entity_name);
|
fprintf(fp_out, "\n");
|
fprintf(fp_out, "\n");
|
Line 324... |
Line 324... |
fprintf(fp_out, " clk => clk,\n");
|
fprintf(fp_out, " clk => clk,\n");
|
fprintf(fp_out, " en => en(%d),\n", rom_num );
|
fprintf(fp_out, " en => en(%d),\n", rom_num );
|
fprintf(fp_out, " we => we,\n");
|
fprintf(fp_out, " we => we,\n");
|
fprintf(fp_out, " rst => rst,\n");
|
fprintf(fp_out, " rst => rst,\n");
|
fprintf(fp_out, " addr => addr(8 downto 0),\n");
|
fprintf(fp_out, " addr => addr(8 downto 0),\n");
|
fprintf(fp_out, " di => wdata,\n");
|
fprintf(fp_out, " di => data_in,\n");
|
fprintf(fp_out, " do => xdata(%d)\n", rom_num );
|
fprintf(fp_out, " do => xdata(%d)\n", rom_num );
|
fprintf(fp_out, " );\n");
|
fprintf(fp_out, " );\n");
|
fprintf(fp_out, "\n");
|
fprintf(fp_out, "\n");
|
}
|
}
|
|
|
Line 339... |
Line 339... |
fprintf(fp_out, " case addr(%d downto %d) is\n", addr_len, rom_len+1 );
|
fprintf(fp_out, " case addr(%d downto %d) is\n", addr_len, rom_len+1 );
|
|
|
for( rom_num=0; rom_num<rom_max; rom_num++ ) {
|
for( rom_num=0; rom_num<rom_max; rom_num++ ) {
|
fprintf(fp_out, " when \"%s\" =>\n", bin_string(rom_num, addr_len-rom_len) );
|
fprintf(fp_out, " when \"%s\" =>\n", bin_string(rom_num, addr_len-rom_len) );
|
fprintf(fp_out, " en(%d) <= cs;\n", rom_num );
|
fprintf(fp_out, " en(%d) <= cs;\n", rom_num );
|
fprintf(fp_out, " rdata <= xdata(%d);\n", rom_num);
|
fprintf(fp_out, " data_out <= xdata(%d);\n", rom_num);
|
}
|
}
|
|
|
fprintf(fp_out, " when others =>\n");
|
fprintf(fp_out, " when others =>\n");
|
fprintf(fp_out, " null;\n");
|
fprintf(fp_out, " null;\n");
|
fprintf(fp_out, " end case;\n");
|
fprintf(fp_out, " end case;\n");
|
} else {
|
} else {
|
fprintf(fp_out, " en(0) <= cs;\n" );
|
fprintf(fp_out, " en(0) <= cs;\n" );
|
fprintf(fp_out, " rdata <= xdata(0);\n" );
|
fprintf(fp_out, " data_out <= xdata(0);\n" );
|
}
|
}
|
fprintf(fp_out, " we <= not rw;\n");
|
fprintf(fp_out, " we <= not rw;\n");
|
fprintf(fp_out, " end process;\n");
|
fprintf(fp_out, " end process;\n");
|
fprintf(fp_out, "end architecture rtl;\n\n");
|
fprintf(fp_out, "end architecture rtl;\n\n");
|
}
|
}
|
Line 384... |
Line 384... |
fprintf(fp_out, " clk : in std_logic;\n");
|
fprintf(fp_out, " clk : in std_logic;\n");
|
fprintf(fp_out, " rst : in std_logic;\n");
|
fprintf(fp_out, " rst : in std_logic;\n");
|
fprintf(fp_out, " cs : in std_logic;\n");
|
fprintf(fp_out, " cs : in std_logic;\n");
|
fprintf(fp_out, " rw : in std_logic;\n");
|
fprintf(fp_out, " rw : in std_logic;\n");
|
fprintf(fp_out, " addr : in std_logic_vector(%d downto 0);\n", addr_len);
|
fprintf(fp_out, " addr : in std_logic_vector(%d downto 0);\n", addr_len);
|
fprintf(fp_out, " rdata : out std_logic_vector(7 downto 0);\n");
|
fprintf(fp_out, " data_out : out std_logic_vector(7 downto 0);\n");
|
fprintf(fp_out, " wdata : in std_logic_vector(7 downto 0)\n");
|
fprintf(fp_out, " data_in : in std_logic_vector(7 downto 0)\n");
|
fprintf(fp_out, " );\n");
|
fprintf(fp_out, " );\n");
|
fprintf(fp_out, "end %s;\n", entity_name);
|
fprintf(fp_out, "end %s;\n", entity_name);
|
fprintf(fp_out, "\n");
|
fprintf(fp_out, "\n");
|
fprintf(fp_out, "architecture rtl of %s is\n", entity_name);
|
fprintf(fp_out, "architecture rtl of %s is\n", entity_name);
|
fprintf(fp_out, "\n");
|
fprintf(fp_out, "\n");
|
Line 425... |
Line 425... |
fprintf(fp_out, " CLK => clk,\n");
|
fprintf(fp_out, " CLK => clk,\n");
|
fprintf(fp_out, " SSR => rst,\n");
|
fprintf(fp_out, " SSR => rst,\n");
|
fprintf(fp_out, " EN => en(%d),\n", rom_num );
|
fprintf(fp_out, " EN => en(%d),\n", rom_num );
|
fprintf(fp_out, " WE => we,\n");
|
fprintf(fp_out, " WE => we,\n");
|
fprintf(fp_out, " ADDR => addr(10 downto 0),\n");
|
fprintf(fp_out, " ADDR => addr(10 downto 0),\n");
|
fprintf(fp_out, " DI => wdata,\n");
|
fprintf(fp_out, " DI => data_in,\n");
|
fprintf(fp_out, " DIP(0) => dp(%d),\n", rom_num );
|
fprintf(fp_out, " DIP(0) => dp(%d),\n", rom_num );
|
fprintf(fp_out, " DO => xdata(%d),\n", rom_num );
|
fprintf(fp_out, " DO => xdata(%d),\n", rom_num );
|
fprintf(fp_out, " DOP(0) => dp(%d)\n", rom_num );
|
fprintf(fp_out, " DOP(0) => dp(%d)\n", rom_num );
|
fprintf(fp_out, " );\n");
|
fprintf(fp_out, " );\n");
|
}
|
}
|
Line 441... |
Line 441... |
fprintf(fp_out, " case addr(%d downto %d) is\n", addr_len, rom_len+1 );
|
fprintf(fp_out, " case addr(%d downto %d) is\n", addr_len, rom_len+1 );
|
|
|
for( rom_num=0; rom_num<rom_max; rom_num++ ) {
|
for( rom_num=0; rom_num<rom_max; rom_num++ ) {
|
fprintf(fp_out, " when \"%s\" =>\n", bin_string(rom_num, addr_len-rom_len) );
|
fprintf(fp_out, " when \"%s\" =>\n", bin_string(rom_num, addr_len-rom_len) );
|
fprintf(fp_out, " en(%d) <= cs;\n", rom_num );
|
fprintf(fp_out, " en(%d) <= cs;\n", rom_num );
|
fprintf(fp_out, " rdata <= xdata(%d);\n", rom_num);
|
fprintf(fp_out, " data_out <= xdata(%d);\n", rom_num);
|
}
|
}
|
|
|
fprintf(fp_out, " when others =>\n");
|
fprintf(fp_out, " when others =>\n");
|
fprintf(fp_out, " null;\n");
|
fprintf(fp_out, " null;\n");
|
fprintf(fp_out, " end case;\n");
|
fprintf(fp_out, " end case;\n");
|
} else {
|
} else {
|
fprintf(fp_out, " en(0) <= cs;\n");
|
fprintf(fp_out, " en(0) <= cs;\n");
|
fprintf(fp_out, " rdata <= xdata(0);\n");
|
fprintf(fp_out, " data_out <= xdata(0);\n");
|
}
|
}
|
fprintf(fp_out, " we <= not rw;\n");
|
fprintf(fp_out, " we <= not rw;\n");
|
fprintf(fp_out, " end process;\n");
|
fprintf(fp_out, " end process;\n");
|
fprintf(fp_out, "end architecture rtl;\n\n");
|
fprintf(fp_out, "end architecture rtl;\n\n");
|
}
|
}
|