T
Torsten Landschoff
Guest
Hi again,
Another thing that bothers me is the number of names that I have to
introduce. For example, my current project is about controlling a LCD
by the FPGA (without cheating by using a PicoBlaze core as in the
starter kit reference designs).
Basically, my main entity looks like this:
entity lcdexample is
port (
-- System clock (50 MHz on starter board)
clock : in std_logic;
-- LCD signals
lcd_enable : out std_logic;
lcd_command : out std_logic;
lcd_write : out std_logic;
lcd_data : inout std_logic_vector(3 downto 0));
end lcdexample;
architecture beh of lcdexample is
...
signal lcd_enable_req : std_logic;
signal lcd_data_wr : unsigned(7 downto 0);
signal lcd_command_wr : std_logic;
signal lcd_ready : std_logic;
begin
...
lcd_driver0 : component lcd_driver
port map (
clock => clock, tick_us => tick_us,
-- Internal interface
data => lcd_data_wr, enable => lcd_enable_req, command =>
lcd_command_wr,
ready => lcd_ready,
-- External interface (to real LCD)
lcd_enable => lcd_enable, lcd_command => lcd_command,
lcd_write => lcd_write, lcd_data => lcd_data);
...
end beh;
Coming from software development, a number of issues strike me:
1) The lcdexample top entity knows about the outputs of the
lcd_driver. If the external interface changes, both lcdexample and
lcd_driver have to be adjusted. I could work around that by using the
record type for the external interface of the LC display but I am not
sure if it is supported by XST. Is there any way that lcd_driver can
connect to external FPGA pins without passing the ports from the
containing component?
With this simple example it looks quite harmless but I wonder about
the final application which could well use >100 of the I/O pins of the
FPGA.
2) Is there any naming convention for the input/output ports and local
signals corresponding to those? I'd like to only have lcd_data,
lcd_command and lcd_enable in lcdhello, which goes through the
lcd_driver entity to the LCD. If there is no solution to (1), how do
you work around that? Any proven naming conventions for ports and
signals?
3) Same goes for the lcd_driver instance. The component is named
lcd_driver but I'd like to name the instance lcd_driver as well. What
do you do for your designs?
4) My little experience with VHDL tells me that the clock signal is
needed just about anywhere, sometimes scaled, inverted or something.
Is there any possibility to create a "singleton" clock source instance
that I can access in the different components? Something like a global
clock signal?
Thanks for any hints!
Friendly, Torsten
Another thing that bothers me is the number of names that I have to
introduce. For example, my current project is about controlling a LCD
by the FPGA (without cheating by using a PicoBlaze core as in the
starter kit reference designs).
Basically, my main entity looks like this:
entity lcdexample is
port (
-- System clock (50 MHz on starter board)
clock : in std_logic;
-- LCD signals
lcd_enable : out std_logic;
lcd_command : out std_logic;
lcd_write : out std_logic;
lcd_data : inout std_logic_vector(3 downto 0));
end lcdexample;
architecture beh of lcdexample is
...
signal lcd_enable_req : std_logic;
signal lcd_data_wr : unsigned(7 downto 0);
signal lcd_command_wr : std_logic;
signal lcd_ready : std_logic;
begin
...
lcd_driver0 : component lcd_driver
port map (
clock => clock, tick_us => tick_us,
-- Internal interface
data => lcd_data_wr, enable => lcd_enable_req, command =>
lcd_command_wr,
ready => lcd_ready,
-- External interface (to real LCD)
lcd_enable => lcd_enable, lcd_command => lcd_command,
lcd_write => lcd_write, lcd_data => lcd_data);
...
end beh;
Coming from software development, a number of issues strike me:
1) The lcdexample top entity knows about the outputs of the
lcd_driver. If the external interface changes, both lcdexample and
lcd_driver have to be adjusted. I could work around that by using the
record type for the external interface of the LC display but I am not
sure if it is supported by XST. Is there any way that lcd_driver can
connect to external FPGA pins without passing the ports from the
containing component?
With this simple example it looks quite harmless but I wonder about
the final application which could well use >100 of the I/O pins of the
FPGA.
2) Is there any naming convention for the input/output ports and local
signals corresponding to those? I'd like to only have lcd_data,
lcd_command and lcd_enable in lcdhello, which goes through the
lcd_driver entity to the LCD. If there is no solution to (1), how do
you work around that? Any proven naming conventions for ports and
signals?
3) Same goes for the lcd_driver instance. The component is named
lcd_driver but I'd like to name the instance lcd_driver as well. What
do you do for your designs?
4) My little experience with VHDL tells me that the clock signal is
needed just about anywhere, sometimes scaled, inverted or something.
Is there any possibility to create a "singleton" clock source instance
that I can access in the different components? Something like a global
clock signal?
Thanks for any hints!
Friendly, Torsten