//-----------------------------------------------------------------------------
//
// Title       : Servos
// Design      : Core
// Author      : mbari###
// Company     : MBARI
//
//-----------------------------------------------------------------------------
//
// File        : E:\ESP\dwarf_fpgas\core\compile\servos.v
// Generated   : Mon Mar  9 09:01:50 2009
// From        : E:\ESP\dwarf_fpgas\core\src\servos.bde
// By          : Bde2Verilog ver. 2.01
//
//-----------------------------------------------------------------------------
//
// Description : 
//
//-----------------------------------------------------------------------------

`ifdef _VCP
`else
`define library(a,b)
`endif


// ---------- Design Unit Header ---------- //
`timescale 1ns / 1ns

module Servos (ASleading,DCOR0CNTHIGHr,DCOR0CNTLOWr,DCOR0THRESHIGHr,DCOR0THRESLOWr,DCOR1CNTHIGHr,DCOR1CNTLOWr,DCOR1THRESHIGHr,DCOR1THRESLOWr,DCORENCCTLw,
DCORIFGr,DCORIFGw,Home_Encoder0,Home_Encoder1,Mclk,MotorIn0,Motorin1,PhaseA_Encoder0,PhaseA_Encoder1,PhaseB_Encoder0,
PhaseB_Encoder1,Reset,inDATA,Hfound0,Hfound1,TP,Tfound0,Tfound1,outDATA) ;

// ------------ Port declarations --------- //
input ASleading;
wire ASleading;
input DCOR0CNTHIGHr;
wire DCOR0CNTHIGHr;
input DCOR0CNTLOWr;
wire DCOR0CNTLOWr;
input DCOR0THRESHIGHr;
wire DCOR0THRESHIGHr;
input DCOR0THRESLOWr;
wire DCOR0THRESLOWr;
input DCOR1CNTHIGHr;
wire DCOR1CNTHIGHr;
input DCOR1CNTLOWr;
wire DCOR1CNTLOWr;
input DCOR1THRESHIGHr;
wire DCOR1THRESHIGHr;
input DCOR1THRESLOWr;
wire DCOR1THRESLOWr;
input DCORENCCTLw;
wire DCORENCCTLw;
input DCORIFGr;
wire DCORIFGr;
input DCORIFGw;
wire DCORIFGw;
input Home_Encoder0;
wire Home_Encoder0;
input Home_Encoder1;
wire Home_Encoder1;
input Mclk;
wire Mclk;
input MotorIn0;
wire MotorIn0;
input Motorin1;
wire Motorin1;
input PhaseA_Encoder0;
wire PhaseA_Encoder0;
input PhaseA_Encoder1;
wire PhaseA_Encoder1;
input PhaseB_Encoder0;
wire PhaseB_Encoder0;
input PhaseB_Encoder1;
wire PhaseB_Encoder1;
input Reset;
wire Reset;
input [7:0] inDATA;
wire [7:0] inDATA;
output Hfound0;
wire Hfound0;
output Hfound1;
wire Hfound1;
output TP;
wire TP;
output Tfound0;
wire Tfound0;
output Tfound1;
wire Tfound1;
output [7:0] outDATA;
wire [7:0] outDATA;

// ----------- Signal declarations -------- //
wire ce0;
wire ce1;
wire NET3720;
wire Sclk;
wire updown0;
wire updown1;
wire Zero0;
wire Zero1;
wire [15:0] Channel0;
wire [15:0] Channel1;

// -------- Component instantiations -------//

Decode U1
(
	.Reset(Reset),
	.Sclk(Sclk),
	.ce(ce0),
	.phaseA(PhaseA_Encoder0),
	.phaseB(PhaseB_Encoder0),
	.updown(updown0)
);



Counter U2
(
	.Reset(Reset),
	.Sclk(Sclk),
	.Zero(Zero0),
	.ce(ce0),
	.count(Channel0),
	.sense(TP),
	.updown(updown0)
);



Holdreg U3
(
	.ASleading(ASleading),
	.DCOR0CNTHIGHr(DCOR0CNTHIGHr),
	.DCOR0CNTLOWr(DCOR0CNTLOWr),
	.DCOR1CNTHIGHr(DCOR1CNTHIGHr),
	.DCOR1CNTLOWr(DCOR1CNTLOWr),
	.Reset(Reset),
	.Sclk(Sclk),
	.ch0in(Channel0),
	.ch1in(Channel1),
	.outDATA(outDATA)
);



HomeConfig U4
(
	.Channel0(Channel0),
	.Channel1(Channel1),
	.DCOR0THRESHIGHr(DCOR0THRESHIGHr),
	.DCOR0THRESLOWr(DCOR0THRESLOWr),
	.DCOR1THRESHIGHr(DCOR1THRESHIGHr),
	.DCOR1THRESLOWr(DCOR1THRESLOWr),
	.DCORENCCTLw(DCORENCCTLw),
	.DCORIFGr(DCORIFGr),
	.DCORIFGw(DCORIFGw),
	.Hfound0(Hfound0),
	.Hfound1(Hfound1),
	.Home_Encoder0(Home_Encoder0),
	.Home_Encoder1(Home_Encoder1),
	.MotorIn0(MotorIn0),
	.MotorIn1(Motorin1),
	.Reset(Reset),
	.Sclk(Sclk),
	.Tfound0(Tfound0),
	.Tfound1(Tfound1),
	.Zero0(Zero0),
	.Zero1(Zero1),
	.inDATA(inDATA),
	.outDATA(outDATA),
	.sense0(TP),
	.sense1(NET3720)
);



Counter U5
(
	.Reset(Reset),
	.Sclk(Sclk),
	.Zero(Zero1),
	.ce(ce1),
	.count(Channel1),
	.sense(NET3720),
	.updown(updown1)
);



Decode U6
(
	.Reset(Reset),
	.Sclk(Sclk),
	.ce(ce1),
	.phaseA(PhaseA_Encoder1),
	.phaseB(PhaseB_Encoder1),
	.updown(updown1)
);



// ----------- Terminals assignment --------//
//	       ---- Input terminals ---         //
assign Sclk = Mclk;

endmodule 
