Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
18 years ago

Custom periferial design

Hi everybody!

I'm developing a custom periferial such as an uart interface.

SOPC builder includes only basic information for my component for example

<div class='quotetop'>QUOTE </div>

--- Quote Start ---

#define FULL_UART_0_NAME "/dev/full_uart_0"# define FULL_UART_0_TYPE "full_uart"# define FULL_UART_0_BASE 0x002010A8# define FULL_UART_0_SPAN 8# define FULL_UART_0_IRQ 5[/b]

--- Quote End ---

when I use standard New Component Wizard.

Unfortunately, I need more information for SW level about the component like those in altera_uart device

<div class='quotetop'>QUOTE </div>

--- Quote Start ---

#define UART_0_BAUD 115200# define UART_0_DATA_BITS 8# define UART_0_FIXED_BAUD 0# define UART_0_PARITY &#39;N&#39;# define UART_0_STOP_BITS 1# define UART_0_USE_CTS_RTS 1# define UART_0_USE_EOP_REGISTER 0# define UART_0_SIM_TRUE_BAUD 0# define UART_0_SIM_CHAR_STREAM ""# define UART_0_FREQ 75000000[/b]

--- Quote End ---

I know that all of them are programmed in class.ptf and xxxx.pl files, moreover, I know that these files are perl scripts. But I&#39;m not familiar with perl.

What I want to know is that there is any information about class.ptf structure or "how to" write .pl files for SOPC bulder specificly?

Thanks in advance!

4 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you have a ptf file for your component (usually named class.ptf), you can specify the parameters in WIZARD_SCRIPT_ARGUMENTS section. Nios II IDE will read this section and generate them into the system.h.

    I am using 6.1 so I am not sure whether this will work in 7.0 and future releases.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Tank you, but unfortunately parameters in WIZARD_SCRIPT_ARGUMENTS section have only fixed values.

    Could enybody reveal how to insert a dinamic parameter into system.h, as an instance clk of a component

    <div class='quotetop'>QUOTE </div>

    --- Quote Start ---

    ...

    $$inputClock = "{{ sopc_get_clock_freq($MOD) }}";

    ...[/b]

    --- Quote End ---

    Thanks in advance
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

    In my experience, it is better to use the new component wizard to generate the correct .ptf file for your peripheral than trying to edit one directly. Although for small changes, I still edit the .ptf.

    The trick is to know how you want to interface to your peripheral and how to reflect this in the component wizard.

    Peter
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    There is one more problem. HDL parameters do not appear within the system.h.

    The wizard showes them and allows to edit but nothing is in system.h

    What can be wrong?