📄 class.ptf
字号:
# Copyright(C) 2002-2003 Altera Corporation
CLASS Sram_UP3
{
ASSOCIATED_FILES
{
Add_Program = "default";
Edit_Program = "default";
Generator_Program = "mk_sram.pl";
}
MODULE_DEFAULTS
{
class = "Sram_UP3";
class_version = "2.0";
iss_model_name = "altera_memory";
HDL_INFO
{
# An interface to this memory requires no additional files
# in the target project directory.
}
WIZARD_SCRIPT_ARGUMENTS
{
sram_memory_size = "128";
sram_memory_units = "1024";
sram_data_width = "16";
CONTENTS srec
{
Kind = "blank"; # one of germs, blank, build, command, textfile, or string
Build_Info = ""; # if Kind is build...
Command_Info = ""; # if Kind is command...
Textfile_Info = ""; # if Kind is textfile
String_Info = ""; # if Kind is string
}
}
SLAVE s1
{
PORT_WIRING
{
PORT data
{
width = "16";
is_shared = "1";
direction = "inout";
type = "data";
}
PORT address
{
width = "16";
is_shared = "1";
direction = "input";
type = "address";
}
PORT read_n
{
width = "1";
is_shared = "1";
direction = "input";
type = "read_n";
}
PORT write_n
{
width = "1";
is_shared = "1";
direction = "input";
type = "write_n";
}
PORT be_n
{
width = "2";
is_shared = "1";
direction = "input";
type = "byteenable_n";
}
PORT select_n
{
width = "1";
is_shared = "0";
direction = "input";
type = "chipselect_n";
}
}
SYSTEM_BUILDER_INFO
{
Bus_Type = "avalon_tristate";
Is_Memory_Device = "1";
Address_Alignment = "dynamic";
Data_Width = "16";
Address_Width = "16";
Has_IRQ = "0";
IRQ_Number = "N/A";
Read_Wait_States = "0";
Write_Wait_States = "0";
Hold_Time = "half_clock";
Base_Address = "--unknown--";
Address_Span = "262144";
}
}
SYSTEM_BUILDER_INFO
{
Is_Enabled = "1";
Instantiate_In_System_Module = "0";
Make_Memory_Model = "1";
Default_Module_Name = "sram";
}
}
USER_INTERFACE
{
USER_LABELS
{
name = "Sram_UP3";
technology = "Memory,UP3 Board Edition";
license = "full";
}
LINKS
{
LINK help
{
title="Written by ZhouBo,Fudan University";
url="www.fudan.edu.cn";
}
}
WIZARD_UI default
{
DEBUG{}
title = "SRAM for UP3 (by Fudan University) - {{ $MOD }}";
CONTEXT
{
WSA = "WIZARD_SCRIPT_ARGUMENTS";
CONTENTS = "WIZARD_SCRIPT_ARGUMENTS/CONTENTS srec";
SBI = "SLAVE s1/SYSTEM_BUILDER_INFO";
MODULE_SBI = "SYSTEM_BUILDER_INFO";
SPWA = "SLAVE s1/PORT_WIRING/PORT address";
SPWD = "SLAVE s1/PORT_WIRING/PORT data";
SPWBE = "SLAVE s1/PORT_WIRING/PORT be_n";
}
# These assignments manage the continuous updating of values
# via the WSA, and some intermediate values.
$$var_byte_count = "{{ $WSA/sram_memory_size * $WSA/sram_memory_units }}"; # aka address span
$$var_word_count = "{{ $$var_byte_count * 8 / $WSA/sram_data_width }}";
$$var_address_bits = "{{ ceil(log2($$var_word_count)) }}"; #
# And now, poke in all those results to the right PTF spots
$SBI/Address_Width = "{{ $$var_address_bits }}";
$SBI/Address_Span = "{{ $$var_byte_count }}";
$SBI/Data_Width = "{{ $WSA/sram_data_width }}";
$SPWA/width = "{{ $$var_address_bits }}";
$SPWD/width = "{{ $WSA/sram_data_width }}";
$SPWBE/width = "{{ $WSA/sram_data_width / 8 }}";
align = "left";
PAGES main
{
select = 1;
# align = "left";
PAGE 1
{
title = "Attributes";
spacing = 12;
GROUP
{
align = "left";
title = "Static RAM";
TEXT
{
title = "The UP3, EP1C6 Edition has one IS61C6416 SRAM chips,<br>arranged as 64k 16-bit words.<br>When use ,do not forget circuits outside the Nios Module<br>";
}
GROUP
{
TEXT
{
title = "Memory Size: ";
}
layout = "horizontal";
EDIT
{
justify = "right";
DATA
{
$WSA/sram_memory_size = "$";
}
}
COMBO
{
DATA
{
$WSA/sram_memory_units = "$";
}
ITEM
{
title = "Bytes";
value = "1";
}
ITEM
{
title = "kB";
value = "1024";
}
}
}
TEXT
{
title = "{{ $$var_address_bits }} Word Aligned Address Bits";
}
}
}
# ----------------------------------------------------------------------------------
# The Contents Page
#
# Lets you select between blank, germs, and various ways to operate on files
#
PAGE 2
{
title = "Simulation";
align = "left";
spacing = "5";
RADIO
{
title = "Do Not Create Simulation Model";
key="d";
DATA {
$CONTENTS/Kind = "blank";
$MODULE_SBI/Make_Memory_Model = "0";}
}
# +-----------------------------------------------
# | Blank contents
RADIO
{
title = "Blank";
tooltip = "Memory will be filled with zeroes";
key="k";
DATA { $CONTENTS/Kind = "blank";
$MODULE_SBI/Make_Memory_Model = "1";}
}
# +-----------------------------------------------
# | Germs for contents
RADIO
{
title = "GERMS Monitor";
tooltip = "A bootable monitor will be built into the memory";
key="G";
DATA { $CONTENTS/Kind = "germs";
$MODULE_SBI/Make_Memory_Model = "1";}
}
# +-----------------------------------------------
# | Default Build (nios-build) for contents
RADIO
{
title = "Build:";
tooltip = "The file(s) specified will be built using nios-convert or nios-build";
layout="horizontal";
DATA { $CONTENTS/Kind = "build";
$MODULE_SBI/Make_Memory_Model = "1";}
EDIT
{
DATA { $CONTENTS/Build_Info = "$"; }
error =
"{{ if ($ == '' && $CONTENTS/Kind == 'build')
'Please specify a file to build the contents.';
}}";
}
BUTTON
{
title = "...";
ACTION select
{
$CONTENTS/Build_Info = "{{ browse($$system_directory, '*.mif,*.srec,*.c,*.s'); }}";
}
}
}
# +----------------------------------------
# | Text File for contents
RADIO
{
title = "File: ";
tooltip = "The specified file will fill the memory";
layout = "horizontal";
DATA { $CONTENTS/Kind = "textfile";
$MODULE_SBI/Make_Memory_Model = "1";}
EDIT
{
DATA { $CONTENTS/Textfile_Info = "$"; }
error =
"{{ if ($ == '' && $CONTENTS/Kind == 'textfile')
'Please specify a text file.';
}}";
}
BUTTON
{
title = "...";
ACTION select
{
$CONTENTS/Textfile_Info = "{{ browse($$system_directory, ''); }}";
}
}
}
# +----------------------------------------
# | Command to generate contents
RADIO
{
title = "Command:";
tooltip = "The command will be run by /bin/sh in the current project directory.<br><i>Use %1 for the resulting S-record file and %2 for SDK directory.</i>";
layout = "horizontal";
DATA { $CONTENTS/Kind = "command";
$MODULE_SBI/Make_Memory_Model = "1";}
EDIT
{
DATA { $CONTENTS/Command_Info = "$"; }
error =
"{{ if ($ == '' && $CONTENTS/Kind == 'command')
'Please specify a command to generate contents.';
}}";
}
}
# +----------------------------------------
# | String for contents
REM RADIO
{
title = "String: ";
tooltip = "The string will be placed into the memory";
layout = "horizontal";
DATA { $CONTENTS/Kind = "string";
$MODULE_SBI/Make_Memory_Model = "1";}
EDIT
{
DATA { $CONTENTS/String_Info = "$"; }
warning =
"{{ if ($ == '' && $CONTENTS/Kind == 'string')
'Please specify a string for contents.';
}}";
}
}
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -