今回は、前回の結果を使って、XPSプロジェクトのAdd IPダイアログで解像度を選択して、その解像度のビデオのパラメータをconstant値に設定することを目指す。pure function でそれを行ったのが、”ある constant の値で、他の constant の値を切り替える3(VHDL編2、XPSプロジェクト)”である。今回は、package を使った前回のVHDLコードを使用する。
MPDファイルの RESOLUTION の項を下のように記述した。
PARAMETER RESOLUTION = 1, DT = INTEGER, RANGE = (0:4), VALUES = (0=VGA, 1=SVGA, 2=XGA, 3=SXGA, 4=HD)
このように記述することにより、ダイアログでは、VGA, SVGA... と表示されるが、値としては integer値を VHDL ファイルに渡すことが出来る。
entity を video_timing にしたので、video_timing IP をXPSプロジェクトに追加した。
video_timing IP のダイアログを出してみた。VGA... などの解像度を選ぶことが出来る。XGAを選択した。
ISE14.7でインプリメントまで成功した。
ISE14.7をシミュレーションモードにした。ISimを起動してコンパイルを行った。
ISimが立ち上がり、XGAの解像度の 1024x768 を表示したので、成功だ。
これで、XPSプロジェクトで解像度を選択して、その解像度のパラメータを設定することが出来たので、これからはこれを整備して使用することにする。Verilog HDLでは、ビデオ用の parameter を include することにする。
MPDファイル、PAOファイル、MUIファイルを下に貼っておく。
video_timing_v2_1_0.mpd から下に示す。
BEGIN video_timing
## Peripheral Options
OPTION IPTYPE = PERIPHERAL
OPTION IMP_NETLIST = TRUE
OPTION STYLE = HDL
OPTION DESC = video_timing
OPTION LONG_DESC = video_timing test IP
OPTION HDL = VHDL
OPTION RUN_NGCBUILD = FALSE
## Bus Interfaces
## Generics for VHDL or Parameters for Verilog
PARAMETER RESOLUTION = 1, DT = INTEGER, RANGE = (0:4), VALUES = (0=VGA, 1=SVGA, 2=XGA, 3=SXGA, 4=HD)
## Ports
PORT oH_ACTIVE_VIDEO = "", DIR = O, VEC=[10:0]
PORT oV_ACTIVE_VIDEO = "", DIR = O, VEC=[10:0]
END
次に、video_timing_v2_1_0.pao を下に貼っておく。注意点としては、必ず package のVHDLファイルを最初に登録しておかないと、ISimでのシミュレーションでエラーが発生する。
lib video_timing_v1_00_a video_timing_pkg.vhd VHDL
lib video_timing_v1_00_a constant_test3.vhd VHDL
最後に、MUIファイルを貼っておく。
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
###############################################################################
## DISCLAIMER OF LIABILITY
##
## This file contains proprietary and confidential information of
## Xilinx, Inc. ("Xilinx"), that is distributed under a license
## from Xilinx, and may be used, copied and/or disclosed only
## pursuant to the terms of a valid license agreement with Xilinx.
##
## XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION
## ("MATERIALS") "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
## EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING WITHOUT
## LIMITATION, ANY WARRANTY WITH RESPECT TO NONINFRINGEMENT,
## MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE. Xilinx
## does not warrant that functions included in the Materials will
## meet the requirements of Licensee, or that the operation of the
## Materials will be uninterrupted or error-free, or that defects
## in the Materials will be corrected. Furthermore, Xilinx does
## not warrant or make any representations regarding use, or the
## results of the use, of the Materials in terms of correctness,
## accuracy, reliability or otherwise.
##
## Xilinx products are not designed or intended to be fail-safe,
## or for use in any application requiring fail-safe performance,
## such as life-support or safety devices or systems, Class III
## medical devices, nuclear facilities, applications related to
## the deployment of airbags, or any other applications that could
## lead to death, personal injury or severe property or
## environmental damage (individually and collectively, "critical
## applications"). Customer assumes the sole risk and liability
## of any use of Xilinx products in critical applications,
## subject only to applicable laws and regulations governing
## limitations on product liability.
##
## Copyright 2009 Xilinx, Inc.
## All rights reserved.
##
## This disclaimer and copyright notice must be retained as part
## of this file at all times.
##
###############################################################################
-->
<!DOCTYPE doc SYSTEM "../../ipdialog.dtd" [
<!-- -->
<!ENTITY RESOLUTION '
<widget id="RESOLUTION">
<key>RESOLUTION</key>
<label>RESOLUTION</label>
<tip></tip>
</widget>
'>
]>
<doc>
<view id="Video Timing">
<display>Video Timing</display>
<group id="Video Timing">
<display>Video Timing</display>
<item>&RESOLUTION;</item>
</group>
</view>
</doc>