OpenCores
URL https://opencores.org/ocsvn/oms8051mini/oms8051mini/trunk

Subversion Repositories oms8051mini

[/] [oms8051mini/] [trunk/] [rtl/] [8051/] [oc8051_comp.v] - Blame information for rev 25

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 dinesha
//////////////////////////////////////////////////////////////////////
2
////                                                              ////
3
////  8051 compare                                                ////
4
////                                                              ////
5
////  This file is part of the 8051 cores project                 ////
6
////  http://www.opencores.org/cores/oms8051mini/                 ////
7
////                                                              ////
8
////  Description                                                 ////
9
////   compares selected inputs and set eq to 1 if they are equal ////
10
////   Is used for conditional jumps.                             ////
11
////                                                              ////
12
////  To Do:                                                      ////
13
////   replace CSS_AZ with CSS_DES                                ////
14
////                                                              ////
15
////  Author(s):                                                  ////
16
////      - Simon Teran, simont@opencores.org                     ////
17
////      - Dinesh Annayya, dinesha@opencores.org                 ////
18
////                                                              ////
19
//////////////////////////////////////////////////////////////////////
20 25 dinesha
////   v0.0 - Dinesh A, 5th Jan 2017
21
////        1. Active edge of reset changed from High to Low
22
//////////////////////////////////////////////////////////////////////
23 2 dinesha
////                                                              ////
24
//// Copyright (C) 2000 Authors and OPENCORES.ORG                 ////
25
////                                                              ////
26
//// This source file may be used and distributed without         ////
27
//// restriction provided that this copyright statement is not    ////
28
//// removed from the file and that any derivative work contains  ////
29
//// the original copyright notice and the associated disclaimer. ////
30
////                                                              ////
31
//// This source file is free software; you can redistribute it   ////
32
//// and/or modify it under the terms of the GNU Lesser General   ////
33
//// Public License as published by the Free Software Foundation; ////
34
//// either version 2.1 of the License, or (at your option) any   ////
35
//// later version.                                               ////
36
////                                                              ////
37
//// This source is distributed in the hope that it will be       ////
38
//// useful, but WITHOUT ANY WARRANTY; without even the implied   ////
39
//// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR      ////
40
//// PURPOSE.  See the GNU Lesser General Public License for more ////
41
//// details.                                                     ////
42
////                                                              ////
43
//// You should have received a copy of the GNU Lesser General    ////
44
//// Public License along with this source; if not, download it   ////
45
//// from http://www.opencores.org/lgpl.shtml                     ////
46
////                                                              ////
47
//////////////////////////////////////////////////////////////////////
48
//
49
// CVS Revision History
50
//
51
// $Log: not supported by cvs2svn $
52
// Revision 1.7  2003/04/25 17:15:51  simont
53
// change branch instruction execution (reduse needed clock periods).
54
//
55
// Revision 1.6  2003/04/02 11:26:21  simont
56
// updating...
57
//
58
// Revision 1.5  2002/09/30 17:33:59  simont
59
// prepared header
60
//
61
//
62
 
63
`include "top_defines.v"
64
 
65
 
66
module oc8051_comp (sel, b_in, cy, acc, des, /*comp_wait, */eq);
67
//
68
// sel          (in)  select whithc sourses to compare (look defines.v) [oc8051_decoder.comp_sel]
69
// b_in         (in)  bit in - output from bit addressable memory space [oc8051_ram_sel.bit_out]
70
// cy           (in)  carry flag [oc8051_psw.data_out[7] ]
71
// acc          (in)  accumulator [oc8051_acc.data_out]
72
// ram          (in)  input from ram [oc8051_ram_sel.out_data]
73
// op2          (in)  immediate data [oc8051_op_select.op2_out -r]
74
// des          (in)  destination from alu [oc8051_alu.des1 -r]
75
// eq           (out) if (src1 == src2) eq = 1  [oc8051_decoder.eq]
76
//
77
 
78
 
79
input [1:0] sel;
80
input b_in, cy/*, comp_wait*/;
81
input [7:0] acc, des;
82
 
83
output eq;
84
 
85
reg eq_r;
86
 
87
assign eq = eq_r;// & comp_wait;
88
 
89
 
90
always @(sel or b_in or cy or acc or des)
91
begin
92
  case (sel) /* synopsys full_case parallel_case */
93
    `OC8051_CSS_AZ  : eq_r = (acc == 8'h00);
94
    `OC8051_CSS_DES : eq_r = (des == 8'h00);
95
    `OC8051_CSS_CY  : eq_r = cy;
96
    `OC8051_CSS_BIT : eq_r = b_in;
97
  endcase
98
end
99
 
100
endmodule

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.