Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Need help on LPM_ROM (Altera)

 
Thread Tools Search this Thread
Old 03-06-2008, 06:38 AM   #1
Default Need help on LPM_ROM (Altera)



Hi group,

I want to simulate VGA signals using VHDL and still working on a code
but currently I'm confused about LPM_ROM.


Now, in order to show a character I'm using an MIF file which is
assigned to LPM_ROM megafunction. Now, the thing I do NOT understand
is how does the LPM_ROM works?

LPM_ROM has some parameters that I have assigned required values to it
but it also has inputs and output as well. In the following LPM_ROM
what should be assigned to the address? (marked with ???)

instance_of_mf : lpm_rom

GENERIC MAP (
LPM_WIDTH => 3,
LPM_WIDTHAD => 10,
LPM_NUMWORDS => 1024,
LPM_FILE => "single_character.mif",
LPM_ADDRESS_CONTROL=> "REGISTERED",
LPM_OUTDATA => "REGISTERED",
LPM_HINT => "REGISTERED",
LPM_TYPE => "REGISTERED",
INTENDED_DEVICE_FAMILY => "REGISTERED"
)
PORT MAP (
address => ????,
inclock => clk25Mhz,
outclock => clk25Mhz,
q => q


Amit
  Reply With Quote
Old 03-06-2008, 10:02 AM   #2
Tricky
 
Posts: n/a
Default Re: Need help on LPM_ROM (Altera)
On Mar 6, 6:38 am, Amit <amit.ko...@gmail.com> wrote:
> Hi group,
>
> I want to simulate VGA signals using VHDL and still working on a code
> but currently I'm confused about LPM_ROM.
>
> Now, in order to show a character I'm using an MIF file which is
> assigned to LPM_ROM megafunction. Now, the thing I do NOT understand
> is how does the LPM_ROM works?
>
> LPM_ROM has some parameters that I have assigned required values to it
> but it also has inputs and output as well. In the following LPM_ROM
> what should be assigned to the address? (marked with ???)
>
> instance_of_mf : lpm_rom
>
> GENERIC MAP (
> LPM_WIDTH => 3,
> LPM_WIDTHAD => 10,
> LPM_NUMWORDS => 1024,
> LPM_FILE => "single_character.mif",
> LPM_ADDRESS_CONTROL=> "REGISTERED",
> LPM_OUTDATA => "REGISTERED",
> LPM_HINT => "REGISTERED",
> LPM_TYPE => "REGISTERED",
> INTENDED_DEVICE_FAMILY => "REGISTERED"
> )
> PORT MAP (
> address => ????,
> inclock => clk25Mhz,
> outclock => clk25Mhz,
> q => q


The address will need to be a 10 bit signal to select which 3 bit word
you want to read out of the memory. This rom you have set up has 1024
words that are 3 bits long. You can only read 1 at a time.

I suggest you go an read up about memory and how it works.


Tricky
  Reply With Quote
Old 03-06-2008, 06:54 PM   #3
Amit
 
Posts: n/a
Default Re: Need help on LPM_ROM (Altera)
On Mar 6, 2:02*am, Tricky <Trickyh...@gmail.com> wrote:
> On Mar 6, 6:38 am, Amit <amit.ko...@gmail.com> wrote:
>
>
>
>
>
> > Hi group,

>
> > *I want to simulate VGA signals using VHDL and still working on a code
> > but currently I'm confused about LPM_ROM.

>
> > Now, in order to show a character I'm using an MIF file which is
> > assigned to LPM_ROM megafunction. Now, the thing I do NOT understand
> > is how does the LPM_ROM works?

>
> > LPM_ROM has some parameters that I have assigned required values to it
> > but it also has inputs and output as well. In the following LPM_ROM
> > what should be assigned to the address? (marked with ???)

>
> > instance_of_mf : lpm_rom

>
> > GENERIC MAP (
> > LPM_WIDTH * * * * * * * => 3,
> > LPM_WIDTHAD * * * * *=> 10,
> > LPM_NUMWORDS * * => 1024,
> > LPM_FILE * * * * * * * * *=> "single_character.mif",
> > LPM_ADDRESS_CONTROL=> "REGISTERED",
> > LPM_OUTDATA * * * * => "REGISTERED",
> > LPM_HINT * * * * * * * * => "REGISTERED",
> > LPM_TYPE * * * * * * * *=> "REGISTERED",
> > INTENDED_DEVICE_FAMILY => "REGISTERED"
> > * * * * * )
> > PORT MAP (
> > address => ????,
> > inclock => clk25Mhz,
> > outclock => clk25Mhz,
> > q => q

>
> The address will need to be a 10 bit signal to select which 3 bit word
> you want to read out of the memory. This rom you have set up has 1024
> words that are 3 bits long. You can only read 1 at a time.
>
> I suggest you go an read up about memory and how it works.- Hide quoted text -
>
> - Show quoted text -


Hi Tricky,

Thanks for your response. Just to make it clear please know there are
two entities. "entity 1" will be embedded into the 2nd one. I'm using
LPM_ROM in the architecture of the 2nd. The problem is that I don't
see any address to map it to LPM_ROM address input.

where does the address come to get mapped to address argument of the
mega function?!

any advice is appreciated.


entity 1:
clock in std_logic
hsync and vsync out std_logic
pixel_row std_logic_vector(8 downto 0)
pixel_col std_logic_vector(9 downto 0 )

entity 2:
clock in std_logic
hsync out std_logic
vsync out std_logic
rgb out std_logic_vector(2 downto 0)
clk25 out std_logic and
Blank_n out std_logic




Amit
  Reply With Quote
Old 03-07-2008, 02:00 AM   #4
Mark McDougall
 
Posts: n/a
Default Re: Need help on LPM_ROM (Altera)
Amit wrote:

> where does the address come to get mapped to address argument of the
> mega function?!


The address is something *you* have to supply from your vga controller.

A vga controller is little more than a handful of counters. The sync
signals are generated when the counters are within a certain range.

There's at least 2 steps involved in displaying text characters on a video
screen.

1. You compute a (text) screen memory address based on the H & V counters
output from your VGA controller, depending on your chosen sceen dimensions
and resolution.
This address is used to read a character code from video RAM. The
simplest solution would use dual-port RAM for video memory.

2. You compute a character ROM address based on the character code and
(possibly) the H & V counters output from your VGA controller.
This address is used to read a pixel value from character ROM.

When you start adding colour information, a 3rd step involves using the
abovementioned pixel value in a palette table lookup.

These operations have to be pipelined, so you need to take that into
account when you sync the final pixel value with the H/VSYNC signals - ie.
you need to delay them by a few clocks.

Regards,

--
Mark McDougall, Engineer
Virtual Logic Pty Ltd, <http://www.vl.com.au>
21-25 King St, Rockdale, 2216
Ph: +612-9599-3255 Fax: +612-9599-3266


Mark McDougall
  Reply With Quote
Old 03-09-2008, 08:53 AM   #5
ramsin
 
Posts: n/a
Default Re: Need help on LPM_ROM (Altera)
On Mar 6, 7:00 pm, Mark McDougall <ma...@vl.com.au> wrote:
> Amit wrote:
> > where does the address come to get mapped to address argument of the
> > mega function?!

>
> The address is something *you* have to supply from your vga controller.
>
> A vga controller is little more than a handful of counters. The sync
> signals are generated when the counters are within a certain range.
>
> There's at least 2 steps involved in displaying text characters on a video
> screen.
>
> 1. You compute a (text) screen memory address based on the H & V counters
> output from your VGA controller, depending on your chosen sceen dimensions
> and resolution.
> This address is used to read a character code from video RAM. The
> simplest solution would use dual-port RAM for video memory.
>
> 2. You compute a character ROM address based on the character code and
> (possibly) the H & V counters output from your VGA controller.
> This address is used to read a pixel value from character ROM.
>
> When you start adding colour information, a 3rd step involves using the
> abovementioned pixel value in a palette table lookup.
>
> These operations have to be pipelined, so you need to take that into
> account when you sync the final pixel value with the H/VSYNC signals - ie.
> you need to delay them by a few clocks.
>
> Regards,
>
> --
> Mark McDougall, Engineer
> Virtual Logic Pty Ltd, <http://www.vl.com.au>
> 21-25 King St, Rockdale, 2216
> Ph: +612-9599-3255 Fax: +612-9599-3266



Thank you Mark for the details.

Regards,
Amit


ramsin
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Altera NIOS II pablogodoy Hardware 0 04-01-2008 01:59 PM
Altera Soft Core parallel tasking? Possible bbiandov Hardware 0 12-02-2006 06:00 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46