UART在VHDL中接收数据

时间:2019-01-10 07:44:02

标签: vhdl uart

我正在尝试用VHDL代码构建一个简单的UART,该代码接收一个字符然后发送回PC。 我的程序基于此示例代码enter link description here。 UART发送正常工作,但是在UART接收下,它什么也没收到。 合成完成后,出现一些有关ff / latch的警告,该警告使“存储”数据为恒定值。

def merge(dicts, key):
    my_dict, return_list = {}, []
    keys = list(sorted(dicts[0]))
    keys.remove(key)
    for dictionary in dicts:
        sorted_dict = {value:dictionary[value] for value in sorted(dictionary)}
        key_value = sorted_dict[key]
        if key_value in my_dict:
            count = 0
            for i3 in sorted_dict.keys():
                if i3!=key:
                    my_dict[key_value][count] += sorted_dict[i3]
                    count+=1
        else:
            my_dict[key_value] = list(sorted_dict.values())
            my_dict[key_value].remove(key_value)
    for dictionary in my_dict:
        new_dictionary = {key: dictionary}
        for i in range(len(keys)):
            new_dictionary[keys[i]] = my_dict[dictionary][i]
        return_list.append(new_dictionary)
    return return_list

请帮助我,谢谢!这是我的基本代码:

WARNING:Xst:1293 - FF/Latch <store_2> has a constant value of 0 in block <uart>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <store_3> has a constant value of 0 in block <uart>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <store_4> has a constant value of 0 in block <uart>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <store_5> has a constant value of 0 in block <uart>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <store_6> has a constant value of 0 in block <uart>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <store_7> has a constant value of 0 in block <uart>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <state1_FSM_FFd8> has a constant value of 0 in block <uart>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <state1_FSM_FFd5> has a constant value of 0 in block <uart>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <state1_FSM_FFd7> has a constant value of 0 in block <uart>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <state1_FSM_FFd6> has a constant value of 0 in block <uart>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <state1_FSM_FFd4> has a constant value of 0 in block <uart>. This FF/Latch will be trimmed during the optimization process.
WARNING:Xst:1896 - Due to other FF/Latch trimming, FF/Latch <state1_FSM_FFd3> has a constant value of 0 in block <uart>. This FF/Latch will be trimmed during the optimization process.

1 个答案:

答案 0 :(得分:1)

有关“ FF /闩锁修整”的警告表明综合工具已确定设计的某些部分(在这种情况下为FF)未使用,因此可以将其删除。对于特定的代码,它表示设计中存在错误,因为store的所有8位都是设计正常工作所必需的。

在进行综合设计时,应先模拟代码以确保功能正确,然后再尝试使设计在硬件(FPGA)上运行。这样的设计仿真将显示它没有按预期工作。可以在Intel Quartus套件中免费使用ModelSim模拟器,以用于小型设计。

您可能应该看一下接收过程的第一行:

...
if state1 = idle1 then
    start <= rx;
end if;
if start = '0' then  --check start bit 0
    state1 <= b11;
...