发新话题
打印

奇怪啊!MAP后的结果就不对,功能仿真是对的?问题回出在哪里咧????多谢!!!!1

奇怪啊!MAP后的结果就不对,功能仿真是对的?问题回出在哪里咧????多谢!!!!1

奇怪啊!MAP后的结果就不对,功能仿真是对的?这是怎么回事的啊??问题回出在哪里咧????多谢!!!!1不是说map只是加了一些期间大额时序信息进去的吗?很小的一个模块,应该没有问题的啊?????郁闷!!!1

TOP

奇怪啊!MAP后的结果就不对,功能仿真是对的?问题回出在哪里咧????多谢!!!!1

把你的代码贴上来,好么?
1 c' [4 s+ q( u$ S) O$ {
learning by doing...

TOP

奇怪啊!MAP后的结果就不对,功能仿真是对的?问题回出在哪里咧????多谢!!!!1

就是实现了5bit补码的加减法啊
; ^" d0 j5 S6 D6 L! r" L7 Kentity bm_calculate_rc is0 h: i, r* Q/ a  x  O2 Z6 M
    Port ( ) J: X( l0 s1 f. f; w  S
    clk       : in std_logic;  M/ z' r8 M% `+ u% V
    branch_out: in std_logic_vector(1 downto 0);0 N! S% M" h9 j9 t; y7 b4 W. ?6 r- R
    code_in   : in std_logic_vector(5 downto 0);
3 l2 C' {* [- S8 N4 d    branch_metricut std_logic_vector(4 downto 0)1 C( E/ w0 _  G- n( s
    );/ ]) \# ^3 O( G: @3 I
end bm_calculate_rc;1 \! s7 h! }+ k: l
architecture Behavioral of bm_calculate_rc is
$ ^7 b0 `, f7 }" Q3 X- jcomponent adder55 is
- D* E" I8 y, {5 D; z! S5 { Port (a:IN std_logic_vector(4 downto 0);, M* X. L$ S2 ]5 M0 K
  b:IN std_logic_vector(4 downto 0);$ Q  }$ O$ m- h) F6 j/ A
  add_result:OUT std_logic_vector(4 downto 0));6 y" E- l! \/ e& Z1 V" e/ S6 x
end component;
6 i, N* }5 I! w2 v7 r, v& b7 ]--signal branch_out_reg : std_logic_vector( 1 downto 0):="00";
& `7 D0 o8 o% [0 m( W- A! ?signal branch_metric_reg :   std_logic_vector( 4 downto 0):="00000";
4 }" a' P/ V3 o, A* c3 T3 N4 fsignal branch_metric_reg00 : std_logic_vector( 4 downto 0):="00000";5 ?6 n  ]; V3 z
signal branch_metric_reg01 : std_logic_vector( 4 downto 0):="00000";: `' s' R9 i! M* ]. T
signal branch_metric_reg10 : std_logic_vector( 4 downto 0):="00000";( `# y+ j# @/ ~0 Q, n
signal branch_metric_reg11 : std_logic_vector( 4 downto 0):="00000";; i5 [: y2 _# F4 D% `
signal in1:  std_logic_vector( 4 downto 0):="00000";# S" _' K5 Y& \
signal in2:  std_logic_vector( 4 downto 0):="00000";7 B# r& A& u& q2 y% m
signal in2_buma:  std_logic_vector( 4 downto 0):="00000";5 D  F: s0 G# _1 p% K# b" `+ M
signal branch_metric_reg_reg00 : std_logic_vector( 4 downto 0):="00000";
. ]2 Y7 I- X2 t6 o, ?  ]. psignal branch_metric_reg_reg01 : std_logic_vector( 4 downto 0):="00000";6 U: w" F6 S( o3 B
begin
( W$ U. W  B$ l0 k process(clk)$ n0 m0 V8 {- |0 U0 `
begin! X/ M( p: k& q8 s( y  k
  if clk'event and clk='1' then
0 T- H) v5 t* x7 @if code_in(5 downto 5)="0" then
0 H5 b6 b7 W" ]( u! g   in1<="00"&code_in(5 downto 3);* s4 s/ z* S9 k+ a0 y
      else% d, ^; \1 [( r" d
    in1<="11"&code_in(5 downto 3);+ `  y* o# U" `$ W3 K- Y
     end if;  Z9 j  e* X  y/ K
   end if;
4 o* h- x7 u/ a- j  end process;" z2 }+ n5 _" W) j* Y) X, z( M
process(clk)3 i* Q* u3 u* f$ n; S) V& |; y- H
begin
2 X9 Y5 V$ s. W" [+ L  if clk'event and clk='1' then0 E( U0 G  F- M
if code_in(2 downto 2)="0" then6 a" j1 ~4 _. s+ Q7 t9 l; O. E
   in2<="00"&code_in(2 downto 0);
5 S& W: Y3 y6 {) [0 M      else1 m5 J. J% r. a' j
    in2<="11"&code_in(2 downto 0);
: U/ O, p7 t, N; a5 y% ?* x) t, ]     end if;
" |9 P  |. [* `; d' \% {9 N   end if;
# v. R# H7 A3 g1 x  end process;
% z( n! [; E$ E' C2 s* _: d- D8 ~% g7 p
bm_calculate00: adder55
' \+ E7 L4 Z; e  port map (a=>in1,6 _7 I) e. i: k8 M% n! p7 J* b
b=>in2,
$ T" D; E8 h6 l. F$ ~- ?add_result=>branch_metric_reg_reg00);
; ]+ @3 b( q$ m. }+ X in2_buma<=not (in2) +'1';
  t8 r" w9 k. g$ Cbm_calculate01: adder55# y" B' P; Z( _  z5 R# ]# ^
  port map (a=>in1,; L, b5 v1 H6 x
b=>in2_buma,, K" K) ]2 E. i" J$ W$ {" B
add_result=>branch_metric_reg_reg01);
. r5 F6 M" [: \# \
/ O' [: O. j9 Q/ L; L* W  branch_metric_reg00 <= branch_metric_reg_reg00;) x% |8 D+ h/ E* h1 G% q% m
  branch_metric_reg01 <= branch_metric_reg_reg01;  7 r3 R, H" A  A. N4 S
  branch_metric_reg10 <= not(branch_metric_reg_reg01)+'1';  
# |* j3 C6 Y7 J/ S9 a5 g' u  y  branch_metric_reg11 <= not(branch_metric_reg_reg00)+'1';
# a" W4 M. B8 T6 }2 w8 t    2 h+ V7 I- `, ~( w& T0 g
process( clk)
* y. W4 w/ W0 ~2 T2 ~ begin% g+ h" R3 ~' j5 l! z# c- D4 D
if clk'event and clk='1' then  ?6 N$ q; ~) M
   case branch_out is) t0 O, C! u% f( q0 a& e# d# G. {
      when "00" => branch_metric_reg<=branch_metric_reg00;
5 L4 c$ r- x6 _- o3 v. p when "01" => branch_metric_reg<=branch_metric_reg01;4 I# C8 ?+ ^% O' ^( Y5 V
when "10" => branch_metric_reg<=branch_metric_reg10;, I9 e# c+ {2 @, C4 J
when "11" => branch_metric_reg<=branch_metric_reg11;# J. M# U2 |) n% ?
when others=> branch_metric_reg<="00000";
( @: N. E1 J0 u# i9 B4 s0 S   end case;
# V) T) B9 L( i8 e end if;
7 A  D% b* ?) F; V end process;+ m: a) w3 V0 f' b2 F, w
branch_metric<=branch_metric_reg;( Y5 O0 W# ?$ A4 D) C( y3 |
end Behavioral;

TOP

奇怪啊!MAP后的结果就不对,功能仿真是对的?问题回出在哪里咧????多谢!!!!1

贴出来了,怎么没有人回应啊?大侠现身!!

TOP

发新话题