Skip to content
Snippets Groups Projects
Commit 4bd51afe authored by Sam Calisch's avatar Sam Calisch
Browse files

added second graph

parent 35e4a0be
No related branches found
No related tags found
No related merge requests found
Pipeline #
Showing with 114 additions and 98 deletions
......@@ -7,6 +7,10 @@
<meta charset="utf-8">
<style>
body {
font: 14px sans-serif;
}
text {
font: 10px sans-serif;
}
.axis path,
......@@ -23,96 +27,109 @@ body {
</style>
<body>
<script src="d3.v3.min.js"></script>
<script>
var margin = {top: 20, right: 20, bottom: 30, left: 40},
<h1>Ring Oscillators</h1>
<p>We started this page to catalog tests of speed for a variety of microprocessors and electronics modules. Here we define speed as how fast information can transit from external electronics into the core where microcode is running and back out again. A good way to test this is by constructing a ring oscillator, which simply sends token back and forth, producing a waveform that can be measured with an oscilloscope.</p>
<h2>GPIO</h2>
<p>To measure speed across a GPIO layer, we use a logic level as out token.</p>
<div id='gpio'></div>
<h2>RF</h2>
<p>To measure speed across a radio link, we use the smallest supported packet.</p>
<div id='rf'></div>
<script>
function make_graph(div_id,json_key,axis_labels,use_khz){
var margin = {top: 20, right: 20, bottom: 30, left: 40},
width = 960 - margin.left - margin.right,
height = 600 - margin.top - margin.bottom;
var x = d3.scale.linear().range([0, width]);
var y = d3.scale.linear().range([height, 0]);
var color = d3.scale.category10();
var xAxis = d3.svg.axis().scale(x).orient("bottom").tickSize(-height,0);
var yAxis = d3.svg.axis().scale(y).orient("left").tickSize(-width,0);
var svg = d3.select(div_id).append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
d3.json("ring.json", function(error, json) {
if (error) throw error;
data = json[json_key];
console.log(data);
update(data);
});
function update(data) {
var cols = d3.scale.category10();
function period_to_freq(p){
if (use_khz) return 1000./p;
else return 1/p;
}
x.domain([0,d3.max(data, function(d) { return 1.1*d.dev_board_price; })]).nice();
y.domain([0,d3.max(data, function(d) { return 1.1*period_to_freq(d.ring_period); })]).nice();
var node = svg.selectAll("g").data(data).enter().append("g").append("a")
.attr("xlink:href", function(d) { return d.subdirectory_path; });
node.append("circle")
.attr("class", "dot")
.attr("cx", function(d) { return x(d.dev_board_price); })
.attr("cy", function(d) { return y( 1.0*period_to_freq(d.ring_period) ); })
.attr("r", 3.5)
.style("fill",function(d,i){return cols(i);});
node.append("text")
.attr("x", function(d) { return x(d.dev_board_price)+5; })
.attr("y", function(d) { return y( 1.0*period_to_freq(d.ring_period) ); })
.style("font-size","15px")
.style("font-family","sans-serif")
.text(function(d) { return d.name; });
svg.insert("g",":first-child")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(xAxis)
.append("text")
.attr("class", "label")
.attr("x", width)
.attr("y", 25)
.style("text-anchor", "end")
.style("font-size","15px")
.text(axis_labels[0]);
svg.insert("g",":first-child")
.attr("class", "y axis")
.call(yAxis)
.append("text")
.attr("class", "label")
.attr("transform", "rotate(-90)")
.attr("y", -25)
.attr("dy", ".2em")
.style("text-anchor", "end")
.style("font-size","15px")
.text(axis_labels[1])
}
var x = d3.scale.linear()
.range([0, width]);
var y = d3.scale.linear()
.range([height, 0]);
var color = d3.scale.category10();
var xAxis = d3.svg.axis()
.scale(x)
.orient("bottom")
.tickSize(-height,0);
var yAxis = d3.svg.axis()
.scale(y)
.orient("left")
.tickSize(-width,0);
var svg = d3.select("body").append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")");
d3.json("ring.json", function(error, json) {
if (error) throw error;
data = json["tests"];
update(data);
});
function update(data) {
var cols = d3.scale.category10();
x.domain(d3.extent(data, function(d) { return 1.1*d.dev_board_price; })).nice();
y.domain(d3.extent(data, function(d) { return 1.1*1000./d.ring_period; })).nice();
var node = svg.selectAll("g").data(data).enter().append("g").append("a")
.attr("xlink:href", function(d) { return d.subdirectory_path; });
node.append("circle")
.attr("class", "dot")
.attr("cx", function(d) { return x(d.dev_board_price); })
.attr("cy", function(d) { return y( 1000./d.ring_period ); })
.attr("r", 3.5)
.style("fill",function(d,i){return cols(i);});
node.append("text")
.attr("x", function(d) { return x(d.dev_board_price)+5; })
.attr("y", function(d) { return y( 1000./d.ring_period ); })
.style("font-size","15px")
.style("font-family","sans-serif")
.text(function(d) { return d.name; });
svg.insert("g",":first-child")
.attr("class", "x axis")
.attr("transform", "translate(0," + height + ")")
.call(xAxis)
.append("text")
.attr("class", "label")
.attr("x", width)
.attr("y", 25)
.style("text-anchor", "end")
.style("font-size","15px")
.text("dev board price ($)");
svg.insert("g",":first-child")
.attr("class", "y axis")
.call(yAxis)
.append("text")
.attr("class", "label")
.attr("transform", "rotate(-90)")
.attr("y", -25)
.attr("dy", ".71em")
.style("text-anchor", "end")
.style("font-size","15px")
.text("ring frequency (MHz)")
}
</script>
make_graph("#gpio","gpio",["dev board price ($)", "ring frequency (MHz)"],0)
make_graph("#rf","rf",["dev board price ($)", "ring frequency (kHz)"],1)
</script>
<!--<a href='http://fab.cba.mit.edu/classes/865.15/people/sam.calisch/9/index.html'><img src='img/ring-speed-vs-cost.png'></a>-->
</body>
</html>
\ No newline at end of file
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
File moved
......@@ -15,7 +15,7 @@
"name":"nrf52",
"serial_number":"",
"subdirectory_path":"rf/nrf52832",
"dev_board_price":5,
"dev_board_price":5.0,
"dev_board_sales link":"",
"ic_price":0.0,
"ic_sales_link":"",
......@@ -25,14 +25,13 @@
"name":"nrf24L01",
"serial_number":"",
"subdirectory_path":"rf/nrf24L01",
"dev_board_price":4,
"dev_board_price":4.0,
"dev_board_sales link":"",
"ic_price":0.0,
"ic_sales_link":"",
"ring_period":390.0
}
],
"gpio":[
{
"name":"nucleo, mbed",
......@@ -42,7 +41,7 @@
"dev_board_sales link":"",
"ic_price":0.0,
"ic_sales_link":"",
"ring_period":700.0
"ring_period":0.7
},
{
"name":"lpc1768, mbed",
......@@ -52,7 +51,7 @@
"dev_board_sales_link":"",
"ic_price":0.0,
"ic_sales_link":"",
"ring_period":400.0
"ring_period":0.4
},
{
"name":"ATmega32u4, Arduino",
......@@ -62,7 +61,7 @@
"dev_board_sales_link":"",
"ic_price":0.0,
"ic_sales_link":"",
"ring_period":22000.0
"ring_period":22.0
},
{
"name":"ATmega32u4, Port",
......@@ -72,7 +71,7 @@
"dev_board_sales_link":"",
"ic_price":0.0,
"ic_sales_link":"",
"ring_period":2200.0
"ring_period":2.2
},
{
"name":"Teensy, Teensyduino",
......@@ -82,7 +81,7 @@
"dev_board_sales_link":"",
"ic_price":0.0,
"ic_sales_link":"",
"ring_period":5500.0
"ring_period":5.5
},
{
"name":"Teensy, Port",
......@@ -92,7 +91,7 @@
"dev_board_sales_link":"",
"ic_price":0.0,
"ic_sales_link":"",
"ring_period":3500.0
"ring_period":3.5
},
{
"name":"RaspberryPi, PythonGPIO",
......@@ -102,7 +101,7 @@
"dev_board_sales_link":"",
"ic_price":0.0,
"ic_sales_link":"",
"ring_period":10000.0
"ring_period":10.0
},
{
"name":"RaspberryPi, C",
......@@ -112,7 +111,7 @@
"dev_board_sales_link":"",
"ic_price":0.0,
"ic_sales_link":"",
"ring_period":400.0
"ring_period":0.4
},
{
"name":"PSoc 5LP, API",
......@@ -122,7 +121,7 @@
"dev_board_sales_link":"",
"ic_price":0.0,
"ic_sales_link":"",
"ring_period":1200.0
"ring_period":1.2
},
{
"name":"PSoc 5LP, Hardware",
......@@ -132,7 +131,7 @@
"dev_board_sales_link":"",
"ic_price":0.0,
"ic_sales_link":"",
"ring_period":160.0
"ring_period":0.16
},
{
"name":"XMega8E5",
......@@ -142,7 +141,7 @@
"dev_board_sales_link":"",
"ic_price":3.00,
"ic_sales_link":"",
"ring_period":252.0
"ring_period":0.252
},
{
"name":"RPiZero, BCM2835",
......@@ -152,7 +151,7 @@
"dev_board_sales_link":"",
"ic_price":0.00,
"ic_sales_link":"",
"ring_period":350
"ring_period":0.35
},
{
"name":"RPiZero, node rpio",
......@@ -162,7 +161,7 @@
"dev_board_sales_link":"",
"ic_price":0.00,
"ic_sales_link":"",
"ring_period":7648
"ring_period":7.648
},
{
"name":"C.H.I.P. pro, shell",
......@@ -172,7 +171,7 @@
"dev_board_sales_link":"",
"ic_price":0.00,
"ic_sales_link":"",
"ring_period":11000000
"ring_period":11000
},
{
"name":"NRF52",
......@@ -182,7 +181,7 @@
"dev_board_sales_link":"",
"ic_price":3.00,
"ic_sales_link":"",
"ring_period":377
"ring_period":0.377
}
]
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment