[ Content | Sidebar ]

VHDL generic subprograms

June 25th, 2022

I recently added support for VHDL-2008 generic subprograms to NVC. As far as I know it’s the first open source VHDL simulator to support them and allows you to write type-generic functions and procedures like this:

function fact generic (type t;
                       function "*"(l, r : t) return t is <>;
                       function "-"(l, r : t) return t is <>;
                       function "<"(l, r : t) return boolean is <>;
                       one : t)
        (n : t) return t is
begin
    if n < one then
        return one;
    else
        return n * fact(n - one);
    end if;
end function;

And then make concrete instances of the generic function:

function fact_int is new fact
    generic map (t => integer, one => 1);
function fact_real is new fact
    generic map (t => real, one => 1.0);

The is <> syntax in the declaration above picks up the default *, -, and < operators for that type from the context so there’s no need to specify them in the generic map.

assert fact_int(5) = 120;
assert fact_real(4.0) = 24.0;

North’s Seat

June 25th, 2022

The highest point in Hastings is called North’s Seat and is actually just behind my old secondary school. I walked up there a few weekends ago to have a look around.

The phone mast at the top

On the summit now there’s only this huge communications antenna but apparently there used to be a lookout post and a gibbet!

Some cow parsley (?) I saw on the way down

View across the Romney Marsh

In the distance we can see a wind farm: what else could be hidden there?! Stay tuned, I’m going to explore it tomorrow.

Into The Marsh

May 30th, 2022

Last Friday was “Day of Care” at work so I decided to head out for an adventure to the wastelands of Romney Marsh.

The marsh is a large area of reclaimed land in Kent. As you might expect it’s very flat and perhaps not the most interesting terrain for walking.

Studying the map beforehand I knew I had to pay a visit to “Sheaty Sewer”, and this wooden bridge over a foetid open sewer vastly exceeded my expectations! (I think “sewer” might mean irrigation channel locally.)

Sheaty sewer

Below is the 800 year old church at St Mary in the Marsh. The church is open to look around during the day.

Church at St Mary in the Marsh

Towards the end I arrived at one of my favourite places, Dungeness! Not only is there a mini train and a lighthouse, there’s not one but two nuclear power plants! I discovered a path between them and the sea. It was very exciting. Below is Dungeness A, the older one, which is being decommissioned now but Dungeness B is still operating.

Dungeness A

Rye to Battle

May 26th, 2022

A somewhat uneventful walk from Rye to Battle, the site of the battle of Hastings no less. Here’s the river Tillingham just outside Rye.

One thing I’ve noticed down here is that footpaths are not nearly as well signposted as they were back up in Oxfordshire. I got lost quite often, including walking in a big circle at one point. Maybe my navigation just sucks now.

Bodium Castle and Robertsbridge

April 26th, 2022

Despite growing up here I’ve never done much exploring of the “interior” of East Sussex. Normally I just go for a walk along the coast in one direction of the other. Well, time to change that: a new programme of exploration is launched! The first mission is north to Bodium Castle and then to Robertsbridge.

A wood just outside Hastings

This was my favourite part of the walk, an unexpectedly lush wood just a few minutes from Hastings hospital.

Bodium Castle

Bodium Castle is basically what you get when you ask a five year old to draw a generic castle. It made a brief film appearance as “Swamp Castle” in Monty Python and the Holy Grail!

Robertsbridge high street

This was the most picturesque part of Robertsbridge, a small town on the Hastings-London train line. I’ve passed through it on the train loads of times but I don’t think this is the first time I’ve ventured into the town itself.

On the map I saw a “Robertsbridge Abbey” but what is left of the ruin is on private land and so a bit of a disappointment.

Goodbye Little Chicken

April 23rd, 2022

Sadly I’ve had to retire my “little chicken” that I’ve been feeding in the Alipay app for the last four years due to a lack of grain. I’ll just put a screenshot here to remember it:

It’s a game of sorts where you collect grain either by buying things with Alipay or “engaging” with the app in some other way, then you feed the grain to the chicken and after a six hour gestation period it will emit an egg. You can then donate your egg to a charitable cause… or something like that. You can also play games with the chicken or dress it up in different outfits, like the stylish purple ski attire mine has. It’s all rather fun. Unfortunately when you don’t feed the chicken for a while it will start to make a nuisance of itself by invading your contacts’ farms and stealing their grain, so I’ve had to put an end to it.

Sidley

April 23rd, 2022

Unseasonably warm and sunny weather on the Easter bank holiday weekend so I decided to go for a walk in the opposite direction along the coast.

The sea was eerily calm, almost like a lake. You can see in the miniscule waves in the picture below.

The rebuilt (and bankrupt) Hastings pier

I got to Bexhill and on a whim decided to divert to Sidley, site of my former sixth form college.

All that remains of Bexhill Sixth Form college

Alas the college has since been demolished: all that hints at its former existence is a residential estate named “Scholar’s Walk” and these old railings. Demolition is a common fate of educational institutions attend by me.

Sidley, but it could be anywhere really

Sidley is pretty nondescript. It doesn’t seem to have changed much in the last 18 years (I think the Aldi is new). I wouldn’t recommend a visit.

Gasson’s Ruin

March 20th, 2022

I suppose I should feel honoured that my family’s ancestral hall has been commentated with this fine information board. However the building itself has seen better days and is not quite the fine palace I was imagining.

The heyday of our family beach hut

… and today’s sorry state

It’s just along the coast from Rye Harbour, which is somewhere I’ve visited many times, but I never saw the “ruin” before.

Mary Stanford lifeboat house

This is the “Mary Stanford” lifeboat house named after the lifeboat that used to be based here which tragically sunk in 1928 drowning all 17 crew.

Here’s the route I took along the coast:

Fishing Boats

March 18th, 2022

Back to Blighty and the weather is glorious! I totally forgot the sky could be this shade of blue. And where better to go than the local beach which festooned with these traditional fishing boats.

Oh how I missed the seagulls

Catchily named “RX142” (RX means “Rye” by the way)

“R4” and various bits of fishing junk

Filed in photos - Comments closed

Chongming Island

March 7th, 2022

Chongming island 崇明岛 is a large island on the north of the Yangtze estuary. And while it’s technically part of Shanghai it’s actually very rural and makes for an interesting day out.

Ferry to Chongming island

Getting there from the city is a bit convoluted. The quickest way is to take subway line 3 to Baoyang Road and take a bus to the ferry terminal of the same name. The ferry takes about 50 minutes and costs 16 RMB. Make sure you get the one to Nanmen 南门 as that’s the most touristy part.

Walking along the Yangtze river

I walked along the bank of the Yangtze river for a little way from the ferry terminal. It was really hazy. Might have been pollution but the air quality report that didn’t seem too bad…

Chongming academy

Next stop was Chongming Academy, an old Confucian school. Nothing spectacular to look at, but there’s some interesting exhibits (in Chinese) in several of the buildings about the history of Chongming island. Apparently it used to be an important centre of cloth production, and now it’s trying to reinvent itself as an ecotourism destination.

After that I took the bus to the wetland park in the north of the island. The bus trip is around an hour, which I wasn’t expecting, but the view along the way was interesting. One thing you’ll notice straight away is almost everyone on the island is old (quite common in rural China). The other noteworthy thing was the number of churches – I counted at least two plus some crosses on walls – which I hardly ever see on the mainland.

Harvested grass in the wetland park

With all the time spent travelling I only had time for two attractions but there’s also some temples and a forest park, so maybe you could make a weekend of it.

Here’s a pro tip: the last boat back to the mainland is at 6pm. If, like me, you miss this it’s also possible to take a long-distance bus back to the mainland via the bridge at the south of the island. The bus leaves from the bus station near the ferry terminal and takes about 1.5 hours to reach a subway station on line 6.