# This file is generated by uxsdcap 0.1.0.
# https://github.com/duck2/uxsdcxx
# Modify only if your build process doesn't involve regenerating this file.
#
# Cmdline: uxsdcxx/uxsdcap.py /home/mohagh18/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd
# Input file: /home/mohagh18/vtr-verilog-to-routing/libs/librrgraph/src/io/rr_graph.xsd

# md5sum of input file: 65eddcc840064bbb91d7f4cf0b8bf821

@0xe787bf7696810419;
using Cxx = import "/capnp/c++.capnp";
$Cxx.namespace("ucap");

enum SwitchType {
	uxsdInvalid @0;
	mux @1;
	tristate @2;
	passGate @3;
	short @4;
	buffer @5;
}

enum SegmentResType {
	uxsdInvalid @0;
	general @1;
	gclk @2;
}

enum PinType {
	uxsdInvalid @0;
	open @1;
	output @2;
	input @3;
}

enum NodeType {
	uxsdInvalid @0;
	chanx @1;
	chany @2;
	source @3;
	sink @4;
	opin @5;
	ipin @6;
}

enum NodeDirection {
	uxsdInvalid @0;
	incDir @1;
	decDir @2;
	biDir @3;
	none @4;
}

enum NodeClkResType {
	uxsdInvalid @0;
	virtualSink @1;
}

enum LocSide {
	uxsdInvalid @0;
	left @1;
	right @2;
	top @3;
	bottom @4;
	rightLeft @5;
	rightBottom @6;
	rightBottomLeft @7;
	topRight @8;
	topBottom @9;
	topLeft @10;
	topRightBottom @11;
	topRightLeft @12;
	topBottomLeft @13;
	topRightBottomLeft @14;
	bottomLeft @15;
}

struct Channel {
	chanWidthMax @0 :Int32;
	xMax @1 :Int32;
	xMin @2 :Int32;
	yMax @3 :Int32;
	yMin @4 :Int32;
}

struct XList {
	index @0 :UInt32;
	info @1 :Int32;
}

struct YList {
	index @0 :UInt32;
	info @1 :Int32;
}

struct Channels {
	channel @0 :Channel;
	xLists @1 :List(XList);
	yLists @2 :List(YList);
}

struct Timing {
	cin @0 :Float32;
	cinternal @1 :Float32;
	cout @2 :Float32;
	r @3 :Float32;
	tdel @4 :Float32;
}

struct Sizing {
	bufSize @0 :Float32;
	muxTransSize @1 :Float32;
}

struct Switch {
	id @0 :Int32;
	name @1 :Text;
	type @2 :SwitchType;
	timing @3 :Timing;
	sizing @4 :Sizing;
}

struct Switches {
	switches @0 :List(Switch);
}

struct SegmentTiming {
	cPerMeter @0 :Float32;
	rPerMeter @1 :Float32;
}

struct Segment {
	id @0 :Int32;
	length @1 :Int32;
	name @2 :Text;
	resType @3 :SegmentResType;
	timing @4 :SegmentTiming;
}

struct Segments {
	segments @0 :List(Segment);
}

struct Pin {
	ptc @0 :Int32;
	value @1 :Text;
}

struct PinClass {
	type @0 :PinType;
	pins @1 :List(Pin);
}

struct BlockType {
	height @0 :Int32;
	id @1 :Int32;
	name @2 :Text;
	width @3 :Int32;
	pinClasses @4 :List(PinClass);
}

struct BlockTypes {
	blockTypes @0 :List(BlockType);
}

struct GridLoc {
	blockTypeId @0 :Int32;
	heightOffset @1 :Int32;
	layer @2 :Int32 = 0;
	widthOffset @3 :Int32;
	x @4 :Int32;
	y @5 :Int32;
}

struct GridLocs {
	gridLocs @0 :List(GridLoc);
}

struct NodeLoc {
	layer @0 :Int32 = 0;
	ptc @1 :Int32;
	side @2 :LocSide;
	twist @3 :Int32;
	xhigh @4 :Int32;
	xlow @5 :Int32;
	yhigh @6 :Int32;
	ylow @7 :Int32;
}

struct NodeTiming {
	c @0 :Float32;
	r @1 :Float32;
}

struct NodeSegment {
	segmentId @0 :Int32;
}

struct Meta {
	name @0 :Text;
	value @1 :Text;
}

struct Metadata {
	metas @0 :List(Meta);
}

struct Node {
	capacity @0 :UInt32;
	clkResType @1 :NodeClkResType;
	direction @2 :NodeDirection;
	id @3 :UInt32;
	name @4 :Text;
	type @5 :NodeType;
	loc @6 :NodeLoc;
	timing @7 :NodeTiming;
	segment @8 :NodeSegment;
	metadata @9 :Metadata;
}

struct RrNodes {
	nodes @0 :List(Node);
}

struct Edge {
	sinkNode @0 :UInt32;
	srcNode @1 :UInt32;
	switchId @2 :UInt32;
	metadata @3 :Metadata;
}

struct RrEdges {
	edges @0 :List(Edge);
}

struct RrGraph {
	toolComment @0 :Text;
	toolName @1 :Text;
	toolVersion @2 :Text;
	channels @3 :Channels;
	switches @4 :Switches;
	segments @5 :Segments;
	blockTypes @6 :BlockTypes;
	grid @7 :GridLocs;
	rrNodes @8 :RrNodes;
	rrEdges @9 :RrEdges;
}
