Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 2 files changed
  • 0 comments
  • 1 contributor
38  README
... ...
@@ -1,25 +1,43 @@
1 1
 Migen (Milkymist Generator)
2 2
   a Python toolbox for building complex digital hardware
3 3
 
4  
-Migen aims at automating further the VLSI design process. Migen makes it
5  
-possible to apply modern software concepts such as object-oriented
6  
-programming and metaprogramming to design hardware. This results in more
7  
-elegant and easily maintained designs and reduces the incidence of human
8  
-errors. Built on these principles, it also provides tools to build
9  
-synchronous designs more productively, integrate system-on-chips, design
10  
-dataflow systems, and more. Migen will become the foundation for the
11  
-next-generation Milkymist SoC.
  4
+Despite being faster than schematics entry, hardware design with Verilog and
  5
+VHDL remains tedious and inefficient for several reasons. The event-driven
  6
+model introduces issues and manual coding that are unnecessary for synchronous
  7
+circuits, which represent the lion's share of today's logic designs. Counter-
  8
+intuitive arithmetic rules result in steeper learning curves and provide a
  9
+fertile ground for subtle bugs in designs. Finally, support for procedural
  10
+generation of logic (metaprogramming) through "generate" statements is very
  11
+limited and restricts the ways code can be made generic, reused and organized.
  12
+
  13
+To address those issues, we have developed the Migen FHDL library that
  14
+replaces the event-driven paradigm with the notions of combinatorial and
  15
+synchronous statements, has arithmetic rules that make integers always behave
  16
+like mathematical integers, and most importantly allows the design's logic to
  17
+be constructed by a Python program. This last point enables hardware designers
  18
+to take advantage of the richness of the Python language - object oriented
  19
+programming, function parameters, generators, operator overloading, libraries,
  20
+etc. - to build well organized, reusable and elegant designs.
  21
+
  22
+Other Migen libraries are built on FHDL and provide various tools such as a
  23
+system-on-chip interconnect infrastructure, a dataflow programming system, a
  24
+more traditional high-level synthesizer that compiles Python routines into
  25
+state machines with datapaths, and a simulator that allows test benches to be
  26
+written in Python.
  27
+
  28
+Migen is the foundation of the next-generation Milkymist SoC.
12 29
 
13 30
 See the doc/ folder for a more complete description.
14 31
 
15 32
 Code repository:
16 33
 https://github.com/milkymist/migen
17  
-Experimental version of the Milkymist SoC based on Migen:
  34
+New Milkymist SoC based on Migen:
18 35
 https://github.com/milkymist/milkymist-ng
19 36
 
20  
-Migen is designed for Python 3.2.
  37
+Migen is designed for Python 3.
21 38
 
22 39
 Send questions, comments and patches to devel [AT] lists.milkymist.org
  40
+There is a lot of room for improvement in many areas, contributions welcome.
23 41
 We are also on IRC: #milkymist on the Freenode network.
24 42
 
25 43
 See LICENSE file for copyright and license info.
8  migen/fhdl/tracer.py
@@ -28,6 +28,11 @@ def get_var_name(frame):
28 28
 		else:
29 29
 			return None
30 30
 
  31
+def remove_underscore(s):
  32
+	if len(s) > 2 and s[0] == "_" and s[1] != "_":
  33
+		s = s[1:]
  34
+	return s
  35
+
31 36
 name_to_idx = defaultdict(int)
32 37
 classname_to_objs = dict()
33 38
 
@@ -44,6 +49,7 @@ def trace_back(varname=None):
44 49
 		if varname is None:
45 50
 			varname = get_var_name(frame)
46 51
 		if varname is not None:
  52
+			varname = remove_underscore(varname)
47 53
 			l.insert(0, (varname, name_to_idx[varname]))
48 54
 			name_to_idx[varname] += 1
49 55
 		
@@ -61,6 +67,7 @@ def trace_back(varname=None):
61 67
 					modules = frame.f_globals["__name__"]
62 68
 					modules = modules.split(".")
63 69
 					coname = modules[len(modules)-1]
  70
+				coname = remove_underscore(coname)
64 71
 				l.insert(0, (coname, name_to_idx[coname]))
65 72
 				name_to_idx[coname] += 1
66 73
 		else:
@@ -76,6 +83,7 @@ def trace_back(varname=None):
76 83
 				except ValueError:
77 84
 					idx = len(objs)
78 85
 					objs.append(obj)
  86
+			classname = remove_underscore(classname)
79 87
 			l.insert(0, (classname, idx))
80 88
 		
81 89
 		varname = None

No commit comments for this range

Something went wrong with that request. Please try again.