我从http://www.intesc.mx/soporte下载了VHDL LCD库,检查语法时出现以下错误:
class ServerUtil
{
public string ServerMessage(string query)
{
return ServerMessageHelperAsync(query).GetAwaiter().GetResult();
}
public async Task<string> ServerMessageAsync(string query)
{
return await ServerMessageHelperAsync(query);
}
private async Task<string> ServerMessageHelperAsync(string query)
{
var baseUri = new UriBuilder("http://darksync-anarchysystems.rhcloud.com/ServletExample/ServletExample");
baseUri.Query = query;
using (var httpClient = new HttpClient(new HttpClientHandler()))
{
try
{
using (var response = await httpClient.GetAsync(baseUri.Uri).ConfigureAwait(false))
{
response.EnsureSuccessStatusCode();
return await response.Content.ReadAsStringAsync();
}
}
catch
{
return "505";
}
}
}
}
class Program
{
static void Main(string[] args)
{
var username = "xxx";
var password = "xxx";
var s = new ServerUtil();
//var resp = s.ServerMessageAsync("action=login&user=" + username + "&password=" + password).GetAwaiter().GetResult();
var resp = s.ServerMessage("action=login&user=" + username + "&password=" + password);
}
}
我在使用( - &gt;)选择的行中收到错误:
Started : "Check Syntax for LIB_LCD_INTESC_REVB".
Running xst...
Command Line: xst -intstyle ise -ifn {D:/My pc/My documents/ISE/Libreria/LIB_LCD_INTESC_REVB.xst} -ofn LIB_LCD_INTESC_REVB.stx
=========================================================================
* HDL Compilation *
=========================================================================
Compiling vhdl file "D:/Drive/Cetys/3R semestre/Digitales 2/Morsese/LCD2x16RevB/LCD2x16RevB/COMANDOS_LCD_REVB.vhd" in Library work.
ERROR:HDLParsers:839 - "D:/Drive/Cetys/3R semestre/Digitales 2/Morsese/LCD2x16RevB/LCD2x16RevB/COMANDOS_LCD_REVB.vhd" Line 77. Selector (Constant 'DATO1' of type STRING) is an unconstrained array.
我知道VHDL的基础知识,但我不知道如何调试这些类型的错误。
感谢您的帮助。
答案 0 :(得分:0)
case语句的选择器不能是string
,因为字符串是不受约束的数组(长度在指定之前是未知的数组)并且不是本地静态类型。 VHDL case语句只接受本地静态类型的选择器。此外,a
,b
,c
...不是字符串文字。您下载的内容不是VHDL。您可以尝试通过修改代码来修复所有这些,但我甚至都不会尝试。它是由不懂VHDL的人编写的,可能还有数以万计的其他问题。无论如何,你可以试试这个,而不是:
FUNCTION CHAR(DATO1 : character) RETURN STD_LOGIC_VECTOR IS
VARIABLE DATAOUT1 : STD_LOGIC_VECTOR(8 DOWNTO 0);
BEGIN
CASE DATO1 IS
WHEN 'a' => RETURN '1'&x"09";
WHEN 'b' => RETURN '1'&x"0A";
WHEN 'c' => RETURN '1'&x"0B";
...
当然,您还必须编辑对CHAR
函数的调用:检查传递的参数是character
,而不是string
。