Example #1
0
File: def.go Project: toma63/dream
// parse the NETS section
// TODO - refactor for reuse (create a parseSection())
func parseNets(db *dream.DBlock, tok_ch <-chan string) {
	frame := parse.TakeN(2, tok_ch)
	count, _ := strconv.Atoi(frame[0])
	for i := 0; i < count; i++ {
		frame = parse.TakeUntil(";", tok_ch)
		net_name := frame[1]
		net := dream.DNet{Name: net_name}
		db.Nets[net_name] = net
	}
	_ = parse.TakeN(2, tok_ch) // consume the END...
}
Example #2
0
File: def.go Project: toma63/dream
// parse the COMPONENTS section
// TODO - refactor for reuse (create a parseSection())
func parseComponents(db *dream.DBlock, tok_ch <-chan string) {
	frame := parse.TakeN(2, tok_ch)
	count, _ := strconv.Atoi(frame[0])
	for i := 0; i < count; i++ {
		frame = parse.TakeUntil(";", tok_ch)
		inst_name := frame[1]
		model_name := frame[2]
		comp := dream.DInst{InstName: inst_name, ModelName: model_name}
		db.Insts[inst_name] = comp
	}
	_ = parse.TakeN(2, tok_ch) // consume the END...
}
Example #3
0
File: def.go Project: toma63/dream
// parse the DESIGN statement
func parseDesign(db *dream.DBlock, tok_ch <-chan string) {
	frame := parse.TakeN(2, tok_ch)
	db.Design = frame[0]
}
Example #4
0
File: def.go Project: toma63/dream
// parse the UNITS DISTANCE MICRONS statement
func parseUnits(db *dream.DBlock, tok_ch <-chan string) {
	frame := parse.TakeN(4, tok_ch)
	db.DBU, _ = strconv.Atoi(frame[2])
}
Example #5
0
File: def.go Project: toma63/dream
// parse the VERSION statement
func parseVersion(db *dream.DBlock, tok_ch <-chan string) {
	frame := parse.TakeN(2, tok_ch)
	db.Version, _ = strconv.ParseFloat(frame[0], 32)
}