diff --git a/html_to_pptx_converter.py b/html_to_pptx_converter.py new file mode 100644 index 0000000..5fdf002 --- /dev/null +++ b/html_to_pptx_converter.py @@ -0,0 +1,241 @@ +#!/usr/bin/env python3 +""" +HTML to PPTX Converter for LLM4Hardware Poster +Converts poster.html to an equivalent PPTX presentation with one slide +""" + +import os +from bs4 import BeautifulSoup +from pptx import Presentation +from pptx.util import Inches, Pt +from pptx.dml.color import RGBColor +from pptx.enum.text import PP_ALIGN, MSO_ANCHOR +from pptx.enum.shapes import MSO_SHAPE + +def hex_to_rgb(hex_color): + """Convert hex color to RGB tuple""" + hex_color = hex_color.lstrip('#') + return tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4)) + +def create_poster_pptx(): + """Create a PPTX file from the poster.html content""" + + # Read the HTML file + with open('poster.html', 'r', encoding='utf-8') as f: + html_content = f.read() + + # Parse HTML with BeautifulSoup + soup = BeautifulSoup(html_content, 'html.parser') + + # Create new presentation + prs = Presentation() + + # Use blank slide layout + blank_slide_layout = prs.slide_layouts[6] # Blank layout + slide = prs.slides.add_slide(blank_slide_layout) + + # Set slide dimensions (16:9 aspect ratio) + prs.slide_width = Inches(13.33) + prs.slide_height = Inches(7.5) + + # Add background gradient (approximating the CSS gradient) + # Create a rectangle covering the entire slide + background = slide.shapes.add_shape( + MSO_SHAPE.RECTANGLE, + Inches(0), Inches(0), + prs.slide_width, prs.slide_height + ) + background.fill.solid() + background.fill.fore_color.rgb = RGBColor(102, 126, 234) # #667eea + background.line.fill.background() + + # Add a white content area (simulating the poster white background) + content_bg = slide.shapes.add_shape( + MSO_SHAPE.RECTANGLE, + Inches(0.5), Inches(0.3), + Inches(12.33), Inches(6.9) + ) + content_bg.fill.solid() + content_bg.fill.fore_color.rgb = RGBColor(255, 255, 255) + content_bg.line.color.rgb = RGBColor(200, 200, 200) + content_bg.shadow.inherit = False + + # Header section with gradient background + header_bg = slide.shapes.add_shape( + MSO_SHAPE.RECTANGLE, + Inches(0.5), Inches(0.3), + Inches(12.33), Inches(1.5) + ) + header_bg.fill.solid() + header_bg.fill.fore_color.rgb = RGBColor(102, 126, 234) # #667eea + header_bg.line.fill.background() + + header_box = slide.shapes.add_textbox( + Inches(1), Inches(0.4), Inches(11.33), Inches(1.3) + ) + header_frame = header_box.text_frame + header_frame.clear() + + # Title + title_p = header_frame.paragraphs[0] + title_p.text = "šŸš€ LLM4Hardware" + title_p.font.size = Pt(40) + title_p.font.bold = True + title_p.font.color.rgb = RGBColor(255, 255, 255) + title_p.alignment = PP_ALIGN.CENTER + + # Subtitle + subtitle_p = header_frame.add_paragraph() + subtitle_p.text = "Generative AI for Chip Design" + subtitle_p.font.size = Pt(20) + subtitle_p.font.color.rgb = RGBColor(255, 255, 255) + subtitle_p.alignment = PP_ALIGN.CENTER + + # GitHub info section + github_box = slide.shapes.add_textbox( + Inches(1), Inches(2.2), Inches(11.33), Inches(0.8) + ) + github_frame = github_box.text_frame + github_frame.clear() + + github_p = github_frame.paragraphs[0] + github_p.text = "šŸ“¦ Repository: github.com/FCHXWH823/LLM4Hardware" + github_p.font.size = Pt(16) + github_p.font.bold = True + github_p.font.color.rgb = RGBColor(51, 51, 51) + github_p.alignment = PP_ALIGN.CENTER + + # Featured projects section + featured_box = slide.shapes.add_textbox( + Inches(0.5), Inches(3.2), Inches(12.33), Inches(1.8) + ) + featured_frame = featured_box.text_frame + featured_frame.clear() + + # Featured title + featured_title = featured_frame.paragraphs[0] + featured_title.text = "🌟 Featured Submodules" + featured_title.font.size = Pt(20) + featured_title.font.bold = True + featured_title.font.color.rgb = RGBColor(229, 81, 0) # #e65100 + featured_title.alignment = PP_ALIGN.CENTER + + # AutoChip project + autochip_p = featured_frame.add_paragraph() + autochip_p.text = "šŸ”§ AutoChip: Generate functional Verilog modules from design prompts using LLMs with iterative error feedback" + autochip_p.font.size = Pt(12) + autochip_p.font.color.rgb = RGBColor(51, 51, 51) + + # Security project + security_p = featured_frame.add_paragraph() + security_p.text = "šŸ›”ļø Security Assertions: LLM-generated SystemVerilog assertions for hardware security verification" + security_p.font.size = Pt(12) + security_p.font.color.rgb = RGBColor(51, 51, 51) + + # C2HLSC project + c2hlsc_p = featured_frame.add_paragraph() + c2hlsc_p.text = "⚔ C2HLSC: Bridge software-to-hardware design gap using LLMs to refactor C code for HLS" + c2hlsc_p.font.size = Pt(12) + c2hlsc_p.font.color.rgb = RGBColor(51, 51, 51) + + # Main topics section (left column - Verilog) + verilog_box = slide.shapes.add_textbox( + Inches(0.5), Inches(5.2), Inches(3.8), Inches(1.8) + ) + verilog_frame = verilog_box.text_frame + verilog_frame.clear() + + verilog_title = verilog_frame.paragraphs[0] + verilog_title.text = "šŸ”§ LLM4Verilog Generation" + verilog_title.font.size = Pt(14) + verilog_title.font.bold = True + verilog_title.font.color.rgb = RGBColor(76, 175, 80) # #4CAF50 + + verilog_projects = [ + "• AutoChip: Functional Verilog generation with LLM feedback", + "• VeriThoughts: Reasoning-based Verilog code generation", + "• ROME: Hierarchical prompting for complex chip design", + "• PrefixLLM: LLM-aided prefix circuit design", + "• Veritas: Deterministic Verilog synthesis from CNF" + ] + + for project in verilog_projects: + p = verilog_frame.add_paragraph() + p.text = project + p.font.size = Pt(10) + p.font.color.rgb = RGBColor(51, 51, 51) + + # Security section (middle column) + security_box = slide.shapes.add_textbox( + Inches(4.7), Inches(5.2), Inches(3.8), Inches(1.8) + ) + security_frame = security_box.text_frame + security_frame.clear() + + security_title = security_frame.paragraphs[0] + security_title.text = "šŸ›”ļø LLM4Security" + security_title.font.size = Pt(14) + security_title.font.bold = True + security_title.font.color.rgb = RGBColor(255, 87, 34) # #FF5722 + + security_projects = [ + "• Security Assertions: Hardware assertion generation for security", + "• Hybrid-NL2SVA: Natural Language to SystemVerilog Assertion", + "• OpenTitan RAG SVA: RAG system for OpenTitan SVA generation", + "• LLMPirate: LLMs for black-box hardware IP piracy", + "• FSM Testbench Gen: Testbench generation and bug detection" + ] + + for project in security_projects: + p = security_frame.add_paragraph() + p.text = project + p.font.size = Pt(10) + p.font.color.rgb = RGBColor(51, 51, 51) + + # C2HLS section (right column) + c2hls_box = slide.shapes.add_textbox( + Inches(8.9), Inches(5.2), Inches(3.8), Inches(1.8) + ) + c2hls_frame = c2hls_box.text_frame + c2hls_frame.clear() + + c2hls_title = c2hls_frame.paragraphs[0] + c2hls_title.text = "⚔ LLM4C2HLS" + c2hls_title.font.size = Pt(14) + c2hls_title.font.bold = True + c2hls_title.font.color.rgb = RGBColor(33, 150, 243) # #2196F3 + + c2hls_projects = [ + "• C2HLSC: Bridge software-to-hardware design gap", + "• HLS Optimization: Automated C-to-HLS code transformation", + "• Masala-CHAI: Large-scale SPICE netlist dataset" + ] + + for project in c2hls_projects: + p = c2hls_frame.add_paragraph() + p.text = project + p.font.size = Pt(10) + p.font.color.rgb = RGBColor(51, 51, 51) + + # Statistics section + stats_box = slide.shapes.add_textbox( + Inches(1), Inches(7.1), Inches(11.33), Inches(0.3) + ) + stats_frame = stats_box.text_frame + stats_frame.clear() + + stats_p = stats_frame.paragraphs[0] + stats_p.text = "šŸ“Š 12+ Research Projects • 7 Git Submodules • 10+ Published Papers • 3 Main Focus Areas" + stats_p.font.size = Pt(12) + stats_p.font.bold = True + stats_p.font.color.rgb = RGBColor(255, 255, 255) + stats_p.alignment = PP_ALIGN.CENTER + + # Save the presentation + output_filename = 'poster.pptx' + prs.save(output_filename) + print(f"PPTX file saved as: {output_filename}") + return output_filename + +if __name__ == "__main__": + create_poster_pptx() \ No newline at end of file diff --git a/poster-pptx-README.md b/poster-pptx-README.md new file mode 100644 index 0000000..dca3534 --- /dev/null +++ b/poster-pptx-README.md @@ -0,0 +1,54 @@ +# Poster PPTX Generation + +This directory contains tools to convert the HTML poster (`poster.html`) to PowerPoint format (`poster.pptx`). + +## Generated Files + +- `poster.pptx` - PowerPoint presentation containing a single slide with the same content as poster.html +- `html_to_pptx_converter.py` - Python script that converts HTML to PPTX +- `verify_pptx.py` - Verification script to check PPTX content + +## Features + +The generated PPTX file contains: + +- **Single slide layout** matching the HTML poster design +- **All text content** from the original HTML poster +- **Color-coded sections** matching the HTML design: + - Green for LLM4Verilog Generation (#4CAF50) + - Red for LLM4Security (#FF5722) + - Blue for LLM4C2HLS (#2196F3) +- **Proper formatting** with emojis, bullet points, and hierarchy +- **Background design** approximating the HTML gradient and layout + +## Content Included + +1. **Header**: Title and subtitle with blue gradient background +2. **Repository Info**: GitHub repository link +3. **Featured Submodules**: AutoChip, Security Assertions, C2HLSC +4. **Three Main Sections**: + - šŸ”§ LLM4Verilog Generation (5 projects) + - šŸ›”ļø LLM4Security (5 projects) + - ⚔ LLM4C2HLS (3 projects) +5. **Statistics**: Project counts and key metrics + +## Usage + +To regenerate the PPTX file: + +```bash +python3 html_to_pptx_converter.py +``` + +To verify the content: + +```bash +python3 verify_pptx.py +``` + +## Dependencies + +- python-pptx +- beautifulsoup4 + +The generated `poster.pptx` file can be opened in Microsoft PowerPoint, Google Slides, or any compatible presentation software. \ No newline at end of file diff --git a/poster.pptx b/poster.pptx new file mode 100644 index 0000000..929ccb4 Binary files /dev/null and b/poster.pptx differ diff --git a/verify_pptx.py b/verify_pptx.py new file mode 100644 index 0000000..14aedd4 --- /dev/null +++ b/verify_pptx.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python3 +""" +PPTX Verification Script +Verifies that the generated PPTX contains the expected content from poster.html +""" + +from pptx import Presentation +import os + +def verify_pptx_content(): + """Verify the content of the generated PPTX file""" + + pptx_file = 'poster.pptx' + + if not os.path.exists(pptx_file): + print(f"āŒ Error: {pptx_file} not found!") + return False + + print(f"āœ… Found PPTX file: {pptx_file}") + + try: + # Load the presentation + prs = Presentation(pptx_file) + + print(f"šŸ“Š Presentation info:") + print(f" - Number of slides: {len(prs.slides)}") + print(f" - Slide width: {prs.slide_width}") + print(f" - Slide height: {prs.slide_height}") + + if len(prs.slides) == 0: + print("āŒ No slides found in presentation!") + return False + + # Check the first (and only) slide + slide = prs.slides[0] + print(f"\nšŸ“„ Slide 1 content:") + print(f" - Number of shapes: {len(slide.shapes)}") + + # Extract all text content + all_text = [] + for shape in slide.shapes: + if hasattr(shape, 'text_frame'): + for paragraph in shape.text_frame.paragraphs: + if paragraph.text.strip(): + all_text.append(paragraph.text.strip()) + + print(f" - Text elements found: {len(all_text)}") + + # Check for key content elements + key_elements = [ + "LLM4Hardware", + "Generative AI for Chip Design", + "github.com/FCHXWH823/LLM4Hardware", + "Featured Submodules", + "AutoChip", + "Security Assertions", + "C2HLSC", + "LLM4Verilog Generation", + "LLM4Security", + "LLM4C2HLS", + "Research Projects" + ] + + found_elements = [] + missing_elements = [] + + for element in key_elements: + found = False + for text in all_text: + if element in text: + found = True + found_elements.append(element) + break + if not found: + missing_elements.append(element) + + print(f"\nāœ… Content verification:") + print(f" - Found elements: {len(found_elements)}/{len(key_elements)}") + + for element in found_elements: + print(f" āœ“ {element}") + + if missing_elements: + print(f"\nāŒ Missing elements:") + for element in missing_elements: + print(f" āœ— {element}") + + print(f"\nšŸ“ All text content:") + for i, text in enumerate(all_text, 1): + print(f" {i}. {text}") + + success = len(missing_elements) == 0 + if success: + print(f"\nāœ… Verification successful! PPTX contains all expected content.") + else: + print(f"\nāš ļø Verification partially successful. Some content may be missing.") + + return success + + except Exception as e: + print(f"āŒ Error reading PPTX file: {e}") + return False + +if __name__ == "__main__": + verify_pptx_content() \ No newline at end of file