String 如何从字符串生成串行信号?

String 如何从字符串生成串行信号?,string,binary,signals,vhdl,String,Binary,Signals,Vhdl,在给定固定延迟或时钟信号的情况下,如何将二进制字符串(例如,01011101000100111,长度可变)表示的数据发送到std_逻辑信号?我希望这是一个测试平台,因此我希望能够以尽可能少的麻烦任意更改二进制字符串,因此我考虑使用generate我谦恭地介绍一个固定延迟版本(毕竟是测试平台代码…)。我已经检查了这个,它工作了,但我在verilog中更舒服,所以这段代码可能不是有史以来最好的VHDL -- -- Clocking out bitstream -- library ieee; us

在给定固定延迟或时钟信号的情况下,如何将二进制字符串(例如,01011101000100111,长度可变)表示的数据发送到std_逻辑信号?我希望这是一个测试平台,因此我希望能够以尽可能少的麻烦任意更改二进制字符串,因此我考虑使用
generate

我谦恭地介绍一个固定延迟版本(毕竟是测试平台代码…)。我已经检查了这个,它工作了,但我在verilog中更舒服,所以这段代码可能不是有史以来最好的VHDL

--
-- Clocking out bitstream
--

library ieee;
use ieee.std_logic_1164.all;

entity stackoverflow_strings is
end stackoverflow_strings;

-- this is testbench code, so we can use "wait"s inside a "for" loop.
architecture rtl of stackoverflow_strings is
signal my_output : std_ulogic;
begin

shift_data : process is
constant my_bits : std_logic_vector := B"100101010000100010101";
begin
   my_output <= '0';
   wait for 10 ns; 
   for i in my_bits'range loop
      my_output <= my_bits(i);
      wait for 10 ns;
   end loop; 

   wait;
end process shift_data;

end rtl;
--
--打卡位流
--
图书馆ieee;
使用ieee.std_logic_1164.all;
实体stackoverflow\u字符串为
结束堆叠U字符串;
--这是测试台代码,所以我们可以在“for”循环中使用“wait”。
stackoverflow_字符串的体系结构rtl是
信号my_输出:标准逻辑;
开始
班次数据:流程为
常数my_位:标准逻辑向量:=B“10010101000010010101”;
开始

我的输出补充了Marty的回答:


要使其计时,请更改
等待10 nss至<代码>等待上升沿(clk)

这实际上做得很好,特别是如果你更真实:)学究式的琐碎-我想把architetcure的名称从RTL改过来-它显然不是RTL描述!