- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
目前的流程似乎可以解决:
process(sel, X)
begin
-- set all to 0
mux_out <= (others => zero);
-- Set input in correct line
mux_out(to_integer(unsigned(sel))) <= X;
end process;
我会用TestBench测试更多的案例,并将结果写在这里,再次感谢大家的帮助:)
==== 上一篇文章 =======我已经通过以下 Paebbles 示例实现了 DEMUX:
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.MATH_REAL.ALL;
use IEEE.NUMERIC_STD.ALL;
entity DeMUX_1toX_N_bits is
generic (
PORTS : POSITIVE := 4;
BITS : POSITIVE := 8 );
port (
sel : in STD_LOGIC_VECTOR(integer(ceil(log2(real(PORTS)))) - 1 downto 0);
X : in STD_LOGIC_VECTOR(BITS - 1 downto 0);
Y : out STD_LOGIC_VECTOR((BITS * PORTS) - 1 downto 0)
);
end;
architecture rtl of DeMUX_1toX_N_bits is
type T_SLVV is array(NATURAL range <>) of STD_LOGIC_VECTOR(BITS - 1 downto 0);
signal mux_out : T_SLVV(PORTS - 1 downto 0);
begin
gen : for i in 0 to PORTS - 1 generate
-- connect Output FLAT VECTOR to the correct T_SLVV lines
Y(((i + 1) * BITS) - 1 downto (i * BITS)) <= mux_out(i);
end generate;
mux_out(to_integer(unsigned(sel))) <= X;
end;
综合工具告诉我“找到了信号 mux_out<3><6> 的 1 位锁存器。锁存器可能是由不完整的 case 或 if 语句生成的。我们不建议在 FPGA/CPLD 设计中使用锁存器,因为它们可能会导致计时问题。”
所以为了解决这个问题,我应该显式地将“0”分配给所有其他输出位?
再次感谢您的帮助:)这种编码方式非常强大,但也很复杂:)
================== 上一篇文章 ====
我正在作为大学实验室开发一个 VHDL 项目(针对 FPGA)。我陷入了数据大小和端口数量参数化的多路复用器和多路分配器的设计上。特别是我找不到编写动态代码的方法(With/Select 语句?)
我想到的是这样的:
use IEEE.STD_LOGIC_1164.ALL;
entity generic_mux is
GENERIC ( inputs: INTEGER := 4; -- number of inputs
size : INTEGER := 8); -- size of each input
Port (
-- ??? how can i define the input data ports if i don't know the exact number?
);
end generic_mux;
architecture arc of generic_mux is
begin
-- how can i use the select as an address? The With/Select needs a
-- defined number of cases...
-- ???
end arc;
预先感谢您的帮助。
最佳答案
使用 VHDL-2008 可以这样做:
library ieee;
use ieee.std_logic_1164.all;
package mux_p is
type slv_array_t is array (natural range <>) of std_logic_vector;
end package;
package body mux_p is
end package body;
library ieee;
use ieee.std_logic_1164.all;
use work.mux_p;
entity mux is
generic(
LEN : natural; -- Bits in each input
NUM : natural); -- Number of inputs
port(
v_i : in mux_p.slv_array_t(0 to NUM - 1)(LEN - 1 downto 0);
sel_i : in natural range 0 to NUM - 1;
z_o : out std_logic_vector(LEN - 1 downto 0));
end entity;
architecture syn of mux is
begin
z_o <= v_i(sel_i);
end architecture;
sel_i
也应该是 std_logic_vector
,其长度源自 NUM
,但上面显示的是与多路复用器相关的代码.
多路复用器的使用示例可以是:
library ieee;
use ieee.std_logic_1164.all;
entity mdl is
port(
a_i : in std_logic_vector(1 downto 0);
b_i : in std_logic_vector(1 downto 0);
c_i : in std_logic_vector(1 downto 0);
sel_i : in natural;
z_o : out std_logic_vector(1 downto 0));
end entity;
architecture syn of mdl is
begin
mux_e : entity work.mux
generic map(
LEN => 2,
NUM => 3)
port map(
v_i(0) => a_i,
v_i(1) => b_i,
v_i(2) => c_i,
sel_i => sel_i,
z_o => z_o);
end architecture;
关于generics - 使用泛型的通用 MUX 和 DEMUX,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34590157/
我正在尝试使用 ffmpeg concat demuxer 从图像生成视频。我正在创建一个带有图像文件路径的文本文件。由于图像可以有不同的持续时间,我使用 duration 过滤器来指定每个图像的持续
我正在尝试使用 LibVLC 最终在更大的应用程序中流式传输视频,但目前我正在处理 tutorial .当前的目标只是流式传输保存在我计算机上的视频 当我用调试器遍历程序时,错误代码 [0000021
我注意到 ffmpeg 的 concat demux 会在时间戳中产生差异,为连接选择的视频之前是用封闭的 gop、相同的帧速率和相同的分辨率编码的。 这些视频也有固定的持续时间,没有小数点。 为连接
概括 当使用 -c copy 调用时,Ffmpeg concat demuxer 会改变视频流的开始时间选项。 再生产 给定一个 before.mp4包含 start_time=0 的视频和音频流和
我正在尝试使用此命令 ffmpeg -f concat -i mylist.txt -c copy finalvideo.webm 连接 6 个相同分辨率和相同编解码器的 WebM 视频文件但结果视频
目前的流程似乎可以解决: process(sel, X) begin -- set all to 0 mux_out zero); -- Set input in corre
目前的流程似乎可以解决: process(sel, X) begin -- set all to 0 mux_out zero); -- Set input in corre
尝试从视频中拆分HLS TS流音频,音频为AAC格式。 关键是要拥有某种AVAset,我以后可以操纵它,然后将其复用回视频。 经过一段时间的搜索后,我找不到可靠的线索,有人可以给我提供受过良好教育的指
我正在尝试使用 LINQ to Objects 进行多路复用和多路分解,但在我看来,这是一个非常棘手的问题。 查看这个多路分解器签名: public static IEnumerable> Demux
我尝试使用 libav 对持续时间约为 20 小时的 mp4 文件进行解复用。我已经编译并测试了 ffmpeg 示例 doc/examples/demuxing_decoding.c。 avforma
对于复杂的 ffmpeg 过滤器,我需要两次相同的输入。为了简单起见,我将使用一个示例,其中我只是将视频与自身叠加。 (在我的实际问题中,过滤器更复杂): ffmpeg -i vid -i vid -
我需要将最多 16 个 channel 的 PCM 音频流拆分为多个立体声流。由于我还没有找到任何能够做到这一点的东西,我正在尝试编写我的第一个 directshow 过滤器。 任何能够分割音频的东西
我正在尝试使用 typefind 元素在运行时选择正确的多路分解器类型。如果我在播放前创建解复用器并在收到“have-type”信号后链接它,一切正常。例如: import sys import gi
问题:使用 ffmpeg concat demuxer 连接的 3 个相同格式的文件(全部一起批量导出,具有相同的设置)。命令运行没有错误(也没有控制台打印输出),但也没有输出文件。 Mac OS 1
解复用 我将 TS 段解复用为音频和视频,如下所示。 ffmpeg -y -i input.ts -vcodec copy -an output_video.ts ffmpeg -y -i input
我正在使用 concat demuxer 连接一堆音频文件。问题是即使我知道格式,文件也缺少 .wav 扩展名。我可以以某种方式使用 -f 之类的东西来告诉 ffmpeg 文本文件中指定的文件的格式吗
我想使用 ffmpeg concat 连接两个视频剪辑。要使用 concat demuxer,两者都应该具有相同的编解码器设置。 clip2 要短得多,所以我想重新编码以匹配 clip1。最初,cli
我正在使用 cobertura 来计算测试覆盖率。我希望我的 ant 脚本回显有关特定包的覆盖信息。 到目前为止,我有:
我正在尝试创建一个小程序,它将获取 mp4 视频并使用 AVFoundation 框架从视频中提取字幕信息。在此过程中,它将创建并返回一个 NSDictionary 元素的 NSArray,格式为 s
如何demux来自 mp4 video 使用 h264 获取视频(ffmpeg 格式)基本流命令行 ? 谢谢 最佳答案 ffmpeg -i input.mp4 -vcodec copy -bsf h2
我是一名优秀的程序员,十分优秀!