Giter Club home page Giter Club logo

m3-python's Introduction

MBus

MBus is the next-generation interconnect that enables the millimeter-scale computing class.

MBus is a chip-to-chip bus designed for ultra-constrained systems. MBus is a multi-master bus supporting an arbitrary number of nodes, priority arbitration, efficient acknowledgements, and extensible addressing, with only four wires and consuming only 3.5 pJ/bit/chip.

MBus is power-aware, enabling the design of power-oblivious systems. Individual chips can fully power off and MBus will automatically take care of all the tricky details.

For more information visit mbus.io.

Repository Layout

This repository contains a reference MBus implementation and is the implementation used by the Michigan Micro Mote project at the University of Michigan. The MBus Verilog is considered stable and has been tested in dozens of fabricated chips.

  • releases: Packaged, formal releases of MBus. Use the latest release if you wish to include MBus in your own projects. The mbus_example directory is the template for creating new releases.
  • mbus: The development directory of MBus.
  • layer_controller: A higher-level interface that wraps the MBus frontend. The layer controller implements the MPQ protocol described in the MBus Specification and provides a register/memory interface to the rest of the chip.
    • The layer controller originally had separate implementations for simpler peripherals and complex chips (the CPU). As of v3, these are now consolidated into a unified design.

Copyright 2015 Regents of the University of Michigan

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

MBus Name and Logo

Use of the MBus name and logo are subject to the MBus Research End User License Agreement.

The agreement is available at http://mbus.io/static/MBus_EULA_v1.0.pdf

m3-python's People

Contributors

lukefahr avatar ppannuto avatar zhiyoong avatar zhiyoongcw avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

lukefahr

m3-python's Issues

Bin Bug

m3_ice goc flash PRCv14_sleep_wakeup/PRCv14_sleep_wakeup.bin
INFO --------------------------------------------------------------------------------
INFO -- M3 ICE Interface
INFO
INFO Guessing ICE is at: /dev/cu.usbserial-A603TU7M
INFO Connected to serial device at /dev/cu.usbserial-A603TU7M
INFO This library supports versions...
INFO 0.1
INFO 0.2
INFO 0.3
INFO This ICE board supports versions...
INFO 0.3 **Chosen version
Traceback (most recent call last):
File "/usr/local/bin/m3_ice", line 9, in
load_entry_point('m3==0.4.4', 'console_scripts', 'm3_ice')()
File "/usr/local/lib/python2.7/site-packages/m3-0.4.4-py2.7.egg/m3/m3_ice.py", line 118, in cmd
m.args.func()
File "/usr/local/lib/python2.7/site-packages/m3-0.4.4-py2.7.egg/m3/m3_common.py", line 651, in cmd_flash
self.m3_ice.read_binfile(self.m3_ice.args.BINFILE)
File "/usr/local/lib/python2.7/site-packages/m3-0.4.4-py2.7.egg/m3/m3_common.py", line 486, in read_binfile
self.hexencoded = m3_common.read_binfile_static(binfile)
File "/usr/local/lib/python2.7/site-packages/m3-0.4.4-py2.7.egg/m3/m3_common.py", line 465, in read_binfile_static
if guess_type_is_hex(binfile):
File "/usr/local/lib/python2.7/site-packages/m3-0.4.4-py2.7.egg/m3/m3_common.py", line 457, in guess_type_is_hex
for line in open(binfile):
File "/usr/local/Cellar/python/2.7.12/Frameworks/Python.framework/Versions/2.7/lib/python2.7/codecs.py", line 314, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0x91 in position 4: invalid start byte

=====================================================================
Patch that will catch the exception and just return false

$ git diff
diff --git a/m3/m3_common.py b/m3/m3_common.py
index 8339a08..015cda0 100644
--- a/m3/m3_common.py
+++ b/m3/m3_common.py
@@ -454,12 +454,15 @@ class m3_common(object):
     @staticmethod
     def read_binfile_static(binfile):
         def guess_type_is_hex(binfile):
-            for line in open(binfile):
-                for c in line.strip():
-                    c = ord(c)
-                    if c < 0x20 or c > 0x7a:
-                        return False
-            return True
+            try:
+                for line in open(binfile):
+                    for c in line.strip():
+                        c = ord(c)
+                        if c < 0x20 or c > 0x7a:
+                            return False
+                return True
+            except UnicodeDecodeError:
+                return False

         if guess_type_is_hex(binfile):
             binfd = open(binfile, 'r')

Snoop bug

======================================================
pip install m3_ice + snoop fails
======================================================$ pip install m3_ice
$ m3_ice snoop
INFO --------------------------------------------------------------------------------
INFO -- M3 ICE Interface
INFO
INFO Guessing ICE is at: /dev/cu.usbserial-A603TU7M
INFO Connected to serial device at /dev/cu.usbserial-A603TU7M
INFO This library supports versions...
INFO 0.1
INFO 0.2
INFO 0.3
INFO This ICE board supports versions...
INFO 0.3 **Chosen version
Traceback (most recent call last):
File "/usr/local/bin/m3_ice", line 11, in
sys.exit(cmd())
File "/usr/local/lib/python2.7/site-packages/m3/m3_ice.py", line 105, in cmd
m.args.func()
File "/usr/local/lib/python2.7/site-packages/m3/m3_ice.py", line 91, in cmd_snoop
snooper = mbus_snooper(self.args, self.ice)
File "/usr/local/lib/python2.7/site-packages/m3/m3_common.py", line 782, in init
for idx,callback in enumerate(self.args.callback):
TypeError: 'NoneType' object is not iterable

======================================================
building from source works

$ git clone https://github.com/mbus/m3-python.git
$ cd m3-python/
$ python setup.py build
$ python setup.py install
$ m3_ice snoop
INFO --------------------------------------------------------------------------------
INFO -- M3 ICE Interface
INFO
INFO Guessing ICE is at: /dev/cu.usbserial-A603TU7M
INFO Connected to serial device at /dev/cu.usbserial-A603TU7M
INFO This library supports versions...
INFO 0.1
INFO 0.2
INFO 0.3
INFO This ICE board supports versions...
INFO 0.3 **Chosen version
INFO Script is waiting to print any MBus messages.
INFO To quit, press Ctrl-C
WARNING No messages for 10 seconds, resetting ICE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.