Functional programming in C++14, instead of templates

According to Christoph Kohlhepp (tip o’ the hat to Greg Jaxon)

C++14 generic lambdas enable a degree of functional programming that has, until now, been impossible in C++.

and

They make C++ constructs more concise.

and

They eliminate many use cases of template syntax that has been a hallmark of C++ since the introduction of the STL.

and

When the C++ standard introduced template, an entire coding style of generic programming unfolded on this which made “<>” as ubiquitous as the pointer symbol “*” had been in C land. With the introduction of generic lambdas to the C++ standard, a genuine functional coding style is about to unfold and perhaps make the keyword auto just as ubiquitous.

 

Using Skype like a professional

IEEE-USA Today’s Engineer published a practical article by John R. Platt , “Tips for Effective Skype Job Interviews“, which is worth reading by anyone who needs to videoconference with a laptop or mobile device for professional reasons. Three takeaway messages are

  1. Practice and fine-tune your Skype setup and manner with a friend until you look professional and can hear and be heard clearly.
  2. Sit no more than an arm’s length away from the camera with your face centered on the screen and the camera at eye level in front of an uncluttered background.
  3. There’s more delay than on a voice-only phone call and it may be made worse by bandwidth issues.

Here are some excerpts from Platt’s article

The first challenge is to think about where … It should be a nice, quiet spot where you won’t be interrupted or bothered … If your house has the potential to be noisy, make sure that people know you need a good hour of quiet and privacy.
 
Take a few minutes to make sure the room has good lighting and lacks visual distractions. You don’t want the person on the other end of the Skype call to struggle to see your face if it is shrouded in darkness. … Bare walls or an office-like setting are best … “If nothing else, buy a screen and put it behind you,” …
 
Next, think about how you’re actually going to set up your device. Whether you’re calling from a desktop computer, laptop or other mobile device, you want to make sure that your camera is set up at eye level. This ensures that the video feed is captured at a natural angle (not pointing up your nose) …
 
Also, make sure the camera isn’t too close to you or too far away from where you’ll be sitting. … You should sit no more than an arm’s length away from the webcam … and then be centered on the screen.
 
Give proper consideration to the audio, too. Do you want to just use the microphone and speakers built into your device, or do you want to wear a headset? You want to make sure that the interviewer can hear you and you can hear them. …
 
Of course, all technology is fallible, so test everything out well before you begin your interview. “The biggest challenge I see over and over is candidates do not test their microphones before connecting,” says software engineer Sid Savara. “It is a huge, huge professional mistake in my opinion. …”
 
Savara suggests “showing up” 30 minutes early for the interview and trying a few test calls with a family member or friend to make sure that everything is working properly. This helps to make sure that your broadband connection is working well enough to handle the video. It also gives you a chance to make sure that the audio sounds crisp and clear and that you didn’t miss anything hiding in the background behind you. (We all go a little “blind” when we’re looking at something we see every day, so an outside set of eyes might see something that has become invisible to you.)
 
If you’re not a frequent Skype user, it might take more than 30 minutes of practice. Make sure you know how the chat, screen-sharing and other features work. You don’t want to be stumbling around during the interview. If you can use Skype with confidence, you’ll be more confident in your interview and be better able to showcase your skills. …
 
 
You’ve already spent some time making sure your video and audio work, so now you need to make sure you look good on camera. “Sit up straight, and don’t treat it like a regular, chilled-out Skype call with friends,” …
 
Figuring out exactly when and where to look at the camera can be difficult. In an in-person interview, it’s easy to make eye contact. That’s impossible on a Skype interview. Spend a good portion of your time looking directly at the camera, since that is “the best way to simulate the type of eye contact that happens in a live interview,” … On the other hand, “don’t stare at the camera, because that will make you look weird,” …
 
Posture and body language matter. “Sit forward in your chair so your energy is in your body,” … “Keep your feet planted on the ground to enable gesturing.” Gestures are important because they help bring you to life on the screen. “The animation will be projected into your voice and show your energy and enthusiasm,” …
 
Even though you have practiced, understand the limits of the technology. “You need to take artificially long pauses on Skype interviews … There is always a little more lag than you think.”

 

 

Bromley & Winkelmann’s programmer’s utility library for SystemVerilog

According to Jonathan Bromley and André Winkelmann in “svlib – a programmer’s utility library for SystemVerilog

svlib is a free, open-source library of utility functions for SystemVerilog. It includes file and string manipulation functions, full regular expression search/replace, easy reading and writing of configuration files, access to environment variables and wall-clock time, and much more.

Paper | Presentation | Download

Britain’s glorious war resisters

According to Adam Hochschild about some anti-war heroes from nearly a century ago

It was in Britain that significant numbers of war resisters first acted on their beliefs and paid the price. They did not even come close to stopping the bloodshed, but their strength of conviction remains one of the glories of a dark time. By the conflict’s end, more than 20,000 British men of military age would refuse the draft. Many, on principle, also refused the noncombatant alternative service offered to conscientious objectors, and more than 6,000 served prison terms under harsh conditions: hard labor, a bare-bones diet, and a strict “rule of silence.” This was one of the largest groups ever jailed for political reasons in a Western democracy. War opponents behind bars also included older men—and a few women—as well. If we could time-travel our way into British prisons in late 1917 and early 1918 we would meet the nation’s leading investigative journalist, a future winner of the Nobel Prize, more than half a dozen future members of Parliament, one future cabinet minister, and a former newspaper editor who was now publishing a clandestine journal for his fellow inmates on toilet paper. It would be rare to find a more distinguished array of people ever imprisoned together.

How to slice a SystemVerilog interface

A synthesizable interface coding example connecting a server to 16 clients. The server is passed a large interface with 16 pairs of request and response words, and each client is passed a small interface that gives access to only one pair. This is done by first passing the big interface to each of the small interfaces, and then passing the small interfaces to the clients using a modport that restricts access to just one pair.

localparam type requestType = byte;
localparam type responseType = int;

module testMod#(N=16);

  wire clk, rst;

  allIfc#(N) allInst(clk, rst);
  serverMod#(N) serverInst(allInst.serverMp);

  for (genvar I = 0; I < N; I++) begin:GEN
    sliceIfc#(I) sliceInst(allInst.clientMp);
    clientMod clientInst(sliceInst.clientMp);
  end

endmodule:testMod


interface automatic allIfc#(N=0)(input clk, rst);

  var requestType Requests[N];
  var responseType Responses[N];

  function requestType requestRead(int index);
    return Requests[index];
  endfunction

  function void responseWrite(int index, responseType response);
    Responses[index] <= response;
  endfunction

  modport clientMp(output Requests, input Responses,
                   input clk, rst);

  modport serverMp(input Requests, output Responses,
                   import requestRead, responseWrite,
                   input clk, rst);

endinterface:allIfc


interface automatic sliceIfc#(I=0)(allIfc.clientMp allInst);

  var requestType request;
  var responseType response;

  assign allInst.Requests[I] = request;
  assign response = allInst.Responses[I];

  function void requestWrite(requestType req);
    request <= req;
  endfunction

  function responseType responseRead();
    return response;
  endfunction

  wire clk = allInst.clk;
  wire rst = allInst.rst;

  modport clientMp(output request, input response,
                   import requestWrite, responseRead,
                   input clk, rst);

endinterface:sliceIfc


module clientMod(sliceIfc.clientMp sliceInst);
  // ...
endmodule


module serverMod#(N=0)(allIfc.serverMp allInst);
  // ...
endmodule

Copyright © 2014 Brad Pierce

SV12 — 12,000+ free downloads of IEEE Std 1800-2012

According to Yatin Trivedi in “Accellera & IEEE-SA: A Case Study for Open Collaboration Success“, as of March 2014 there had been over 12,000 free downloads of the new SystemVerilog IEEE Std 1800-2012.

Cumulative downloads of some important EDA standards

Experience can delay innovation — and let new competitors pass you by

According to Kurt Shuler, regarding a presentation about four best practices “learned from the most successful SoC companies”.

What stops people from doing best practices that at first look seems obvious?

The more experienced a team is, the harder it usually is for them to change or adopt new methods. This is because it is simpler in the short term to patch what isn’t working any longer, rather than solve the issue for the long term. It’s easier in the long term to continue doing things, “the way we do things around here.”

The problem is that there are new competitors to the fabless companies. And they have less legacy experience and are eager to adopt best practices and become world class right away. I’m not talking about the new companies in mainland China creating world-class SoCs; rather I’m talking about the fabless semi vendors’ best customers!

I spent some time explaining a simplified view of the semiconductor value chain (slide 11), highlighting companies like Google, Amazon, Microsoft, Apple and eBay that have hired their own chip design teams to either design custom chips, or to provide very specific requirements and even IP to incumbent fabless companies. A look at slide 12 shows how much more cash these companies have than their fabless semi suppliers. And a quick search of LinkedIn will show how extensively they have hired chip design talent from our industry.

Follow

Get every new post delivered to your Inbox.

Join 68 other followers